summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_cleanup_nodes.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-01-06 15:28:54 +0100
committerHolger Levsen <holger@layer-acht.org>2016-01-06 15:28:54 +0100
commit46fcc07a51eec653c8befc10471346897e1e8e54 (patch)
tree8c03975826d478284f2266149f64f4589e16596f /bin/reproducible_cleanup_nodes.sh
parent6e33809f9bbaaab62f4d9ba7a76a5291a9163694 (diff)
downloadjenkins.debian.net-46fcc07a51eec653c8befc10471346897e1e8e54.tar.xz
reproducible: fix perms to clean up nodes
Diffstat (limited to 'bin/reproducible_cleanup_nodes.sh')
-rwxr-xr-xbin/reproducible_cleanup_nodes.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/reproducible_cleanup_nodes.sh b/bin/reproducible_cleanup_nodes.sh
index 49094ac9..c6dd7d26 100755
--- a/bin/reproducible_cleanup_nodes.sh
+++ b/bin/reproducible_cleanup_nodes.sh
@@ -10,10 +10,13 @@ common_init "$@"
# common code defining db access
. /srv/jenkins/bin/reproducible_common.sh
-# only run this on the main node
+# only run this on the main node as jenkins
if [ "$HOSTNAME" != "jenkins" ] ; then
echo "this script must only be run on the main node, aborting."
exit 1
+elif [ "$(whoami)" != "jenkins" ] ; then
+ echo "this script must only be run as jenkins user, aborting."
+ exit 1
fi
# deny running this if jenkins is still running