diff --git a/update.cfg.example b/update.cfg.example index b2da474..fcda8c6 100644 --- a/update.cfg.example +++ b/update.cfg.example @@ -29,3 +29,14 @@ # OUT+=("$LIST_DIR/others.hosts") #OUT=() #URL=() + +# What to run in order to restart dnsmasq. Leave empty to restart manually. +# Note: if you need shell features, use (bash -c '...') +# Typical value: +# Ubuntu/Debian/CentOS: +# DNSMASQ_RESTART_COMMAND=(service dnsmasq restart) +# Slackware: +# DNSMASQ_RESTART_COMMAND=(/etc/rc.d/rc.dnsmasq restart) +# Mac OSX (with homebrew): +# DNSMASQ_RESTART_COMMAND=(brew services restart dnsmasq) +#DNSMASQ_RESTART_COMMAND=() diff --git a/update.sh b/update.sh index 9ec6543..81b68f5 100755 --- a/update.sh +++ b/update.sh @@ -25,6 +25,7 @@ BLOCKLIST=$WORKDIR/block.list LIST_DIR=$WORKDIR/lists OUT=() URL=() +DNSMASQ_RESTART_COMMAND=() if [[ -f $CFG ]]; then . "$CFG" fi @@ -90,6 +91,6 @@ if [[ -n $BACKUPSUFFIX && -f $BLOCKLIST$BACKUPSUFFIX ]]; then fi fi -if [[ -x /etc/rc.d/rc.dnsmasq ]]; then - /etc/rc.d/rc.dnsmasq restart +if [[ ${#DNSMASQ_RESTART_COMMAND[@]} -gt 0 ]]; then + "${DNSMASQ_RESTART_COMMAND[@]}" fi