-
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/runit: Improve logic around shoelaces mappings
- Loading branch information
1 parent
dac1e14
commit 5d5d4c9
Showing
4 changed files
with
28 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
#!/bin/sh | ||
|
||
while true ; do | ||
if /usr/local/bin/netbox-dhcp-hosts | sort > /run/dhcp-hosts.next ; then | ||
if /usr/local/bin/netbox-dhcp-hosts ; 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 | ||
fi | ||
|
||
if ! diff /var/lib/shoelaces/mappings.yaml /var/lib/shoelaces/mappings.yaml.next ; then | ||
if [ -n "$SHOELACES_TAG_PREFIX" ] ; then | ||
mv /var/lib/shoelaces/mappings.yaml.next /var/lib/shoelaces/mappings.yaml | ||
sv restart shoelaces | ||
fi | ||
fi | ||
fi | ||
sleep 600 | ||
sleep "$REFRESH_INTERVAL" | ||
done |