What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Tutorial Automatically Reboot Asus Router on Network Failures

@Net Noob try this:

1. Variable interface name (dynamic)
Hardcoded "wgs1_enable" (not dynamic)
ENABLED=$(nvram get wgs1_enable)

to

ENABLED=$(nvram get "${IF}_enable")

2. Incorrect NVRAM Check (s/b 1 or 0)
Checking for value "2"
if [ -z "$2" ] || [ -z "$ENABLED" ] || [ "$ENABLED" -ne "2" ] ; then

to

if [ "$ENABLED" -eq 1 ]; then

3. Cleanup/simplify
if [ -z "$1" ] || [ -z "$ENABLED" ] || [ "$ENABLED" -ne "1" ] ; then
# ...
if [ -z "$1" ] ; then
# ...
fi
fi

to

if [ "$ENABLED" -ne 1 ]; then
# Deactivate
else
# Activate
fi

4. Add service restart
service restart_wgs
service restart_dnsmasq

5. Act/Deact hardcoded to variable
nvram set wgs1_enable=0
nvram set wgs1_enable=1

to

nvram set "${IF}_enable=0"
nvram set "${IF}_enable=1"
 
Last edited:

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top