fix: dkpurge->dkprune, better perm test

This commit is contained in:
AngeD 2022-10-22 18:04:30 +02:00
parent 815eb821d2
commit 3e402bdc91
4 changed files with 7 additions and 7 deletions

View file

@ -28,8 +28,8 @@ function add_opt() {
echo "$RESULT"
}
if ! docker container ls > /dev/null 2>&1 && [ "$EUID" != 0 ]; then
exec sudo -- "$0" "$@"
if ! [ -w "/var/run/docker.sock" ] && [ "$EUID" != 0 ]; then
sudo -- "$0" "$@"
fi
c=1
@ -73,11 +73,11 @@ while getopts hcCviIna o; do
esac
done
if [ "$((CLEAN & C))" == "$C" ]; then # C
if [ "$((CLEAN & C))" == "$C" ]; then
docker container ls -aq | xargs docker stop
fi
if [ "$((CLEAN & c))" == "$c" ]; then # C
if [ "$((CLEAN & c))" == "$c" ]; then
docker container prune -f
fi