dotfiles/.bin/sysclean-rm

18 lines
326 B
Plaintext
Raw Normal View History

#!/bin/sh
LIST="$(doas sysclean -a)"
FILES="$(echo "$LIST" | grep -v ^@)"
USERS="$(echo "$LIST" | grep ^@user)"
GROUPS="$(echo "$LIST" | grep ^@group)"
if [ ! -z "$FILES" ]
then
echo "$FILES"
echo -n "Delete these? [y/N] "
read
case $REPLY in
[yY]) echo "$FILES" | xargs doas rm -rf; ;;
esac
fi