summaryrefslogtreecommitdiffstats
path: root/bin/common-functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/common-functions.sh')
-rwxr-xr-xbin/common-functions.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/common-functions.sh b/bin/common-functions.sh
index 45c16f0c..583d5b5c 100755
--- a/bin/common-functions.sh
+++ b/bin/common-functions.sh
@@ -11,6 +11,11 @@ common_cleanup(){
common_init() {
# check whether this script has been started from /tmp already
if [ "${0:0:5}" != "/tmp/" ] ; then
+ # check that we are not root
+ if [ $(id -u) -eq 0 ] ; then
+ echo "Do not run this as root."
+ exit 1
+ fi
# mktemp some place for us...
TTT=$(mktemp --tmpdir=/tmp jenkins-script-XXXXXXXX)
# prepare cleanup