Im a complete newbie to this.
So Im using putty and navigated to /usr/bin
Theres no mt1300_led_deamon that even exists.
Im also using wireguard. Note that if anyone is looking at this and uses wireguard instead, you’ll need to check for the existence of /sys/class/net/wg instead.*
It doesnt for me.
Dont know how to 'open' these files if they did exist?
Besides ./whatever.sh which I did here:
Ping works turn led to – solid white
Ping doesn’t work – blink blue
Copy the below code block and paste it in Putty
cat << "EOF" > /usr/bin/mt1300_led_deamon
#!/bin/sh
ip="8.8.8.8" # Is google there?
count="1" # Ping Once
timeout="1"
mt1300_led off # Initalize led to OFF
mt1300_led blue_breath daemon # and then to normal blink blue startup
while true; do
status=$(ping -q -c "$count" -W "$timeout" "$ip" > /dev/null 2>&1 && echo "ok" || echo "fail")
if [ "$status" = "ok" ]; then # if google responds then
mt1300_led white daemon # turn led on solid white
else
mt1300_led blue_breath daemon # otherwise make sure it returns to blink blue
fi
sleep 10
done
EOF
Make it executable by issuing the below in Putty chmod +x /usr/bin/mt1300_led_deamon
Restart the daemon by issuing the below in Putty /etc/init.d/led restart