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
10 #get the semaphore, 0 - disbaled, 1- enabled
\r
11 flag=$(cat ${enable_logic_flag_file})
\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
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
29 echo "Auto mounting ISO & run install logic disabled!"
\r
33 # * * * * * /mount_iso_script.sh
\r