Initial OpenECOMP MSO commit
[so.git] / packages / arquillian-unit-tests / src / test / resources / resource-examples / asdc / simpleNotif-V2 / artifacts / mount_iso_script.sh
1 #!/bin/bash\r
2 \r
3 #. .config \r
4 #following would be in the .config file\r
5  device_name="/dev/vde"\r
6  install_script="install_nimbus.sh"\r
7  enable_logic_flag_file=".flag"\r
8 #end of config file\r
9 \r
10 #get the semaphore, 0 - disbaled, 1- enabled\r
11 flag=$(cat ${enable_logic_flag_file})\r
12 \r
13 #check if device is mounted already\r
14 test=$(mount | grep ${device_name})\r
15 if [ "$flag" == "1" ]; then\r
16         if [ -e ${device_name} ] && [ ! "${test}" ]; then\r
17                 #mount the iso image\r
18                 mount -t iso9660 -v -o loop /dev/vde/ /mnt/iso\r
19                 #if availabe run the install script (it contains the install.sh steps)\r
20                 if [ -e "${install_script}" ] && [ -f "${install_script}" ]; then\r
21                         ${install_script}\r
22                 fi\r
23                 #disable the script from attempting to \r
24                 #  mount and run install again until needed;\r
25                 echo "0" > ${enable_logic_flag_file}\r
26                 #if nedeed add step to comment out the crontab line here;\r
27         fi\r
28 else\r
29         echo "Auto mounting ISO & run install logic disabled!"\r
30 fi\r
31 \r
32 #cron job\r
33 # * * * * * /mount_iso_script.sh\r
34 \r