Update 2023-10-23 15:31 OpenBSD/amd64-dalek

This commit is contained in:
c0dev0id 2023-10-23 15:31:20 +02:00
parent 6b75137276
commit b80c9573e5
1 changed files with 22 additions and 2 deletions

View File

@ -3,8 +3,8 @@
LIST="$(doas sysclean -a)"
FILES="$(echo "$LIST" | grep -v ^@)"
USERS="$(echo "$LIST" | grep ^@user)"
GROUPS="$(echo "$LIST" | grep ^@group)"
USERS="$(echo "$LIST" | grep ^@user | cut -d" " -f2 | cut -d":" -f1)"
GROUPS="$(echo "$LIST" | grep ^@group | cut -d" " -f2 | cut -d":" -f1)"
if [ ! -z "$FILES" ]
then
@ -15,3 +15,23 @@ then
[yY]) echo "$FILES" | xargs doas rm -rf; ;;
esac
fi
if [ ! -z "$USERS" ]
then
echo "$USERS"
echo -n "Delete these users? [y/N] "
read
case $REPLY in
[yY]) echo "$USERS" | xargs -n1 doas userdel; ;;
esac
fi
if [ ! -z "$GROUPS" ]
then
echo "$GROUPS"
echo -n "Delete these groups? [y/N] "
read
case $REPLY in
[yY]) echo "$GROUPS" | xargs -n1 doas groupdel; ;;
esac
fi