Adding iozone-stop.sh script.
authorPhilipp Plüss <philipp.pluess@bfh.ch>
Thu, 25 Jun 2015 15:00:02 +0000 (17:00 +0200)
committerPhilipp Plüss <philipp.pluess@bfh.ch>
Thu, 25 Jun 2015 15:00:02 +0000 (17:00 +0200)
iozone-stop.sh [new file with mode: 0644]

diff --git a/iozone-stop.sh b/iozone-stop.sh
new file mode 100644 (file)
index 0000000..0ff25b2
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+# create lockfile to disable/enable automatic run of iozone-test.sh
+
+set -e
+
+_LOCKFILE="/root/disable_script.txt"
+
+if [ -f $_LOCKFILE ]; then
+       echo "lockfile already exists"
+       read -n 1 -p "want to delete? (Y/N)" ans;
+       case $ans in
+               Y|y)
+                       echo ""
+                       echo "jeah"
+                       rm -f $_LOCKFILE
+                       ;;
+               N|n)
+                       echo ""
+                       echo "no"
+                       exit 0
+                       ;;
+               *)
+                       echo ""
+                       echo "doh"
+                       exit 0
+                       ;;
+       esac
+else
+       touch $_LOCKFILE
+       echo "lockfile $_LOCKFILE created"
+fi