-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dealing with a race condition that comes up when there is NOT a dhcpd server on the network. This causes the apinger template to never become populated and thus the wifi radios remain up. Adding the apinger template to default once to 8.8.8.8 regardless of being triggered from the dhcp client. Additionally, there seems to be a second race condition that if the wireless radio is brought down too early in the startup process it doesnt actually power down the radios. It leaves them in a weird state of radios are up, leds are on, but the wifi cli tool thinks there off.
- Loading branch information
1 parent
c01db16
commit 5deb893
Showing
4 changed files
with
23 additions
and
6 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
if [ -z ${1} ]; then | ||
echo "[ERROR] require arg for setting the gateway" | ||
exit 1 | ||
fi | ||
|
||
sed "s/<DEFAULTGATEWAY>/${1}/g" /etc/apinger.tmpl > /tmp/apinger.conf | ||
# Only restart apinger if compare has diff | ||
if ! cmp /tmp/apinger.conf /etc/apinger.conf; then | ||
# Cant use "service" since thats a shell function | ||
sleep 5 | ||
cp /tmp/apinger.conf /etc/apinger.conf && /etc/init.d/apinger restart | ||
fi |