mirror of
https://github.com/gSpotx2f/luci-app-internet-detector.git
synced 2025-12-14 15:36:51 +03:00
v0.3. Internet detector daemon
This commit is contained in:
14
led/etc/internet-detector/run-script
Executable file
14
led/etc/internet-detector/run-script
Executable file
@@ -0,0 +1,14 @@
|
||||
# Shell commands that are executed every time the Internet is checked for availability
|
||||
#
|
||||
# $1 : (0|1) - internet status: 0 is up, 1 is down
|
||||
#
|
||||
|
||||
LEDN=1
|
||||
LED_CMD="/usr/bin/internet-detector-led.sh"
|
||||
LED_STATE=`$LED_CMD state $LEDN`
|
||||
|
||||
if [ $LED_STATE -eq 0 -a $1 -eq 0 ]; then
|
||||
$LED_CMD on $LEDN
|
||||
elif [ $LED_STATE -ne 0 -a $1 -eq 1 ]; then
|
||||
$LED_CMD off $LEDN
|
||||
fi
|
||||
Reference in New Issue
Block a user