-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: Support generating the shoelaces mapping file.
- Loading branch information
1 parent
751b815
commit dac1e14
Showing
5 changed files
with
100 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
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
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,6 +1,17 @@ | ||
#!/bin/sh | ||
|
||
while true ; do | ||
/usr/local/bin/netbox-dhcp-hosts > /run/dhcp-hosts && pkill -SIGHUP dnsmasq | ||
if /usr/local/bin/netbox-dhcp-hosts | sort > /run/dhcp-hosts.next ; then | ||
if ! diff /run/dhcp-hosts /run/dhcp-hosts.next ; then | ||
echo "Updated host mappings, reloading services" | ||
mv /run/dhcp-hosts.next /run/dhcp-hosts | ||
|
||
pkill -SIGHUP dnsmasq | ||
|
||
if [ -n "$SHOELACES_TAG_PREFIX" ] ; then | ||
sv restart shoelaces | ||
fi | ||
fi | ||
fi | ||
sleep 600 | ||
done |