aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2017-02-19 12:35:04 +0200
committerMichael Lando <ml636r@att.com>2017-02-19 12:35:04 +0200
commitf5f13c4f6b6fe3b4d98e349dfd7db59339803436 (patch)
tree72caffc93fab394ffa3b761505775331f1c559b9 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
parent451a3400b76511393c62a444f588a4ed15f4a549 (diff)
push addional code
Change-Id: Ia427bb3460cda3a896f8faced2de69eaf3807b74 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
new file mode 100644
index 0000000000..da5d9c4e9a
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/resources/nimbus/mount_iso_script.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+#. .config
+#following would be in the .config file
+ device_name="/dev/vde"
+ install_script="install_nimbus.sh"
+ enable_logic_flag_file=".flag"
+#end of config file
+
+#get the semaphore, 0 - disbaled, 1- enabled
+flag=$(cat ${enable_logic_flag_file})
+
+#check if device is mounted already
+test=$(mount | grep ${device_name})
+if [ "$flag" == "1" ]; then
+ if [ -e ${device_name} ] && [ ! "${test}" ]; then
+ #mount the iso image
+ mount -t iso9660 -v -o loop /dev/vde/ /mnt/iso
+ #if availabe run the install script (it contains the install.sh steps)
+ if [ -e "${install_script}" ] && [ -f "${install_script}" ]; then
+ ${install_script}
+ fi
+ #disable the script from attempting to
+ # mount and run install again until needed;
+ echo "0" > ${enable_logic_flag_file}
+ #if nedeed add step to comment out the crontab line here;
+ fi
+else
+ echo "Auto mounting ISO & run install logic disabled!"
+fi
+
+#cron job
+# * * * * * /mount_iso_script.sh
+