Jump to content

Go script delay


pyrater

Recommended Posts

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

Link to comment

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}"

 

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...