check if user is root or in docker group

This commit is contained in:
Asif Bacchus 2020-03-13 03:08:06 -06:00
parent 860cc1408f
commit 9680c93574

View File

@ -15,6 +15,13 @@ if ! command -v wget > /dev/null 2>&1; then
exit 1 exit 1
fi fi
# is user root or in the docker group?
if [ ! "$( id -u )" -eq 0 ]; then
if ! id -Gn | grep docker > /dev/null; then
consoleError '1' "You must either be root or in the 'docker' group to run this script since you must be able to run 'docker exec' commands against the container!"
fi
fi
# zero counters # zero counters
updatesAvailable=0 updatesAvailable=0
downloadFailed=0 downloadFailed=0