Reputation: 303
I want set timeout in my shell script, this is my code:
/etc/init.d/ntp stop
until ping -nq -c3 8.8.8.8; do
echo "Waiting for network..."
done
ntpdate -s time.nist.gov
/etc/init.d/ntp start
I want set time out 30 seconds, if more than 30 seconds I want kill that process and change to this process:
hwclock -s
Thankyou
Upvotes: 0
Views: 1201