Commit 6bfe6f31 authored by Holger Levsen's avatar Holger Levsen

common-functions.sh: prevent running as root

parent fa823e46
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment