feat: dkpurge auto sudo and better documentation
This commit is contained in:
parent
0226791b14
commit
17333b1992
14
bin/dkpurge
14
bin/dkpurge
@ -7,11 +7,11 @@ Options:
|
|||||||
-h Show this help and exits
|
-h Show this help and exits
|
||||||
-c Remove stopped containers
|
-c Remove stopped containers
|
||||||
-C Remove all containers
|
-C Remove all containers
|
||||||
-v Remove volumes not used by at least one container
|
-v Remove unused volumes
|
||||||
-i Remove all dangling images
|
-i Remove unused images
|
||||||
-I Remove all images
|
-I Remove all images
|
||||||
-n Remove networks not used by at least one container
|
-n Remove unused networks
|
||||||
-a All of the above (-CvIn)
|
-a All of the above, equivalent of -CvIn
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -23,13 +23,15 @@ function add_opt() {
|
|||||||
for o in "$@"; do
|
for o in "$@"; do
|
||||||
if [ "$((RESULT & o))" == 0 ]; then
|
if [ "$((RESULT & o))" == 0 ]; then
|
||||||
RESULT="$((RESULT + o))"
|
RESULT="$((RESULT + o))"
|
||||||
else
|
|
||||||
RESULT="$RESULT"
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "$RESULT"
|
echo "$RESULT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ! docker container ls > /dev/null 2>&1 && [ "$EUID" != 0 ]; then
|
||||||
|
exec sudo -- "$0" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
c=1
|
c=1
|
||||||
C=2
|
C=2
|
||||||
v=4
|
v=4
|
||||||
|
Loading…
Reference in New Issue
Block a user