pyrater Posted June 27, 2013 Share Posted June 27, 2013 Is it possible to do a go script delay until after the array mounts? IE. #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & ifconfig eth1 up sudo ifconfig eth1 192.168.1.11 sleep until array mounts python /mnt/cache/.custom/sickbeard/Sick-Beard/SickBeard.py Quote Link to comment
mrow Posted June 27, 2013 Share Posted June 27, 2013 while ! test -d /mnt/disk1;do sleep 5;done;sleep 10 Quote Link to comment
JonathanM Posted June 27, 2013 Share Posted June 27, 2013 while ! test -d /mnt/disk1;do sleep 5;done;sleep 10 That code assumes the disk1 slot is populated. You will need to change disk1 to one of your in use slots if you don't have slot 1 filled. Quote Link to comment
WeeboTech Posted June 27, 2013 Share Posted June 27, 2013 Another consideration is that is that it's not a pause, it's a halt. Here is what I use for now while [[ ${LOOP:=10} -gt 1 && ! -b /dev/md1 ]] do (( LOOP=LOOP-1 )) echo "Waiting for /dev/md1 to come online ($LOOP)" sleep 1 done sleep 1 This is another version I've been working on. #!/bin/bash [ ${DEBUG:=0} -gt 0 ] && set -x -v declare -a CHAR=('+' 'x'); let i=0 let maxcount=60 DIR=/mnt/disk1 while ! read -n1 -t1 -p "Waiting for ${DIR} press ANY key to stop ($maxcount): [${CHAR[${i}]}]: " do echo -e "\r\c" [[ -d ${DIR} ]] && break [[ $(( maxcount-=1 )) -lt 1 ]] && break [[ $(( i+=1 )) -ge ${#CHAR[@]} ]] && let i=0; done echo echo "maxcount=$maxcount REPLY=${REPLY}" Quote Link to comment
pyrater Posted June 27, 2013 Author Share Posted June 27, 2013 awesome ty all for the reply's!!! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.