summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_cleanup_nodes.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2016-07-31 23:21:54 -0400
committerHolger Levsen <holger@layer-acht.org>2016-07-31 23:21:54 -0400
commit1999a3a3f9f393aed75e51dad488e21bf3ae0cbb (patch)
tree46562102ea8737acab554cb37b63958e57c15f18 /bin/reproducible_cleanup_nodes.sh
parent4359bc14b77522046547f877725650689cf7b5f2 (diff)
downloadjenkins.debian.net-1999a3a3f9f393aed75e51dad488e21bf3ae0cbb.tar.xz
add --force option
Diffstat (limited to 'bin/reproducible_cleanup_nodes.sh')
-rwxr-xr-xbin/reproducible_cleanup_nodes.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/reproducible_cleanup_nodes.sh b/bin/reproducible_cleanup_nodes.sh
index cad6bfa5..9656a651 100755
--- a/bin/reproducible_cleanup_nodes.sh
+++ b/bin/reproducible_cleanup_nodes.sh
@@ -20,12 +20,14 @@ elif [ "$(whoami)" != "jenkins" ] ; then
fi
# deny running this if jenkins is still running
-RESULT=$(ps fax|grep '/usr/share/jenkins/jenkins.war'|grep -v grep||true)
-if [ -n "$RESULT" ] ; then
- echo "jenkins is still running, aborting."
- exit 1
-else
- echo "jenkins is not running, ok, let's go."
+if [ "$1" != "--force" ] ; then
+ RESULT=$(ps fax|grep '/usr/share/jenkins/jenkins.war'|grep -v grep||true)
+ if [ -n "$RESULT" ] ; then
+ echo "jenkins is still running, aborting."
+ exit 1
+ else
+ echo "jenkins is not running, ok, let's go."
+ fi
fi
# simple confirmation needed