-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lime-proto-bmx6: Add bmx6hosts_dnsmasq_update script
Executed by Cron checks if bmx6 hosts file has changed and send HUB to dnmasq Signed-off-by: Pau Escrich <p4u@dabax.net>
- Loading branch information
Showing
4 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/bin/sh | ||
echo "adding bmx6 IPv6 addresses to it's own hosts file" | ||
echo "*/5 * * * * bmx2hosts > /var/hosts/bmx6" >> /etc/crontabs/root | ||
echo "adding bmx6 IPv6 addresses to dnsmasq hosts file directory" | ||
echo "*/4 * * * * /usr/bin/bmx6hosts_dnsmasq_update" >> /etc/crontabs/root |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
bmx6hosts > /var/hosts/bmx6 | ||
new=/tmp/bmx6hosts.new.md5 | ||
last=/tmp/bmx6hosts.last.md5 | ||
touch $last | ||
md5sum /var/hosts/bmx6| awk '{print $1}' > $new | ||
[ "$(cat $new)" != "$(cat $last)" ] && { | ||
logger -t bmx6hosts "New bmx6 hosts found, updating dnsmasq" | ||
killall -HUP dnsmasq | ||
} | ||
cp -f $new $last |