Skip to content

Instantly share code, notes, and snippets.

@shimarin
Last active June 29, 2019 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shimarin/e78bb63716732b70d2b7b89dae965e3b to your computer and use it in GitHub Desktop.
Save shimarin/e78bb63716732b70d2b7b89dae965e3b to your computer and use it in GitHub Desktop.
#!/bin/bash
# addn-hosts=/var/lib/misc/dhcp-hosts
# dhcp-script=/etc/dnsmasq.sh
ADDN_HOSTS=/var/lib/misc/dhcp-hosts
case "$1" in
"add" ) echo "$3" `echo $2 | sed 's/://g'`.dhcp > $ADDN_HOSTS/$3 ;;
"del" ) rm -f $ADDN_HOSTS/$3 ;;
"old" ) exit ;;
esac
echo `date` $1 $2 $3 >> /var/log/dnsmasq.log
kill -HUP $PPID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment