From 9680c93574063e370823d767f38e65a655e7950f Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 13 Mar 2020 03:08:06 -0600 Subject: [PATCH] check if user is root or in docker group --- template-update.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/template-update.sh b/template-update.sh index c3c50ab..c43c527 100755 --- a/template-update.sh +++ b/template-update.sh @@ -15,6 +15,13 @@ if ! command -v wget > /dev/null 2>&1; then exit 1 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 updatesAvailable=0 downloadFailed=0