Files
tareo-scripts/server/checkdnsmasq.sh

11 lines
316 B
Bash
Raw Normal View History

2016-02-26 02:22:04 +01:00
#!/bin/bash
if [ ! -e /etc/cron.d/checkdnsmasq ]; then
echo "* * * * * root /root/tareo-scripts/server/checkdnsmasq.sh" > /etc/cron.d/checkdnsmasq
fi
if [ "$(service dnsmasq status | tail -n 1 | grep -q "(running)"; echo $?)" != "0" ]; then
echo "dnsmasq not running, restart now"
service dnsmasq restart
fi