lock CRUNCH_DISPATCH_LOCKFILE while running, if provided
[arvados.git] / services / api / script / restart-dnsmasq
1 #!/usr/bin/env bash
2
3 # usage:
4 # "restart-dnsmasq" (restart now if needed)
5 # or
6 # "restart-dnsmasq -d" (wait for restart to be needed, restart, repeat)
7
8 while :
9 do
10   if [ -e /etc/dnsmasq.d/restart.txt ] && rm /etc/dnsmasq.d/restart.txt
11   then
12     echo restarting
13     /etc/init.d/dnsmasq restart
14   fi
15   if [ "-d" = "$1" ]
16   then
17     sleep 2
18   else
19     exit
20   fi
21 done