What's new

Anyone notice WPS turn itself back on?

  • 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!

ADFHogan

Regular Contributor
I was having a look at my router today after updating to 66_4 and noticed that WPS was enabled again. Anyone else noticed it turn back on?

Not too worried, I turned it off again :) ... how it ever became part of the WiFi standard given the way it's implemented - I mean who writes an authentication protocol that says "So, have I got the first half right?" :)
 
Yes, known issue with some routers. I added the following to the services-start script which will disable it after the router finishes booting.
This will restart the wireless radios and correctly disables the WPS (assuming that it's set to disabled).
Code:
/sbin/service restart_wireless
 
Just noticed the same. Installed 380.66_4 yesterday, running flawlessly for >22 hours now. Just ran the security assesment and noticed WPS was turned back on. Was about to post wether this is a limitation to nvram-restore.sh which I used to restore my settings, when I read here that it's a known issue. @Zirescu, thanks for the trick to disable it again when it finishes booting. WPS... IMHO, the correct pronouncement is Wortheless Piece of .... Well, you get the picture :rolleyes:

Edit: I've added

Code:
/sbin/service restart_wireless

at the end of the services-start script. Is that okay, or should I put it at the beginning, before the entware lines and, in my, case the call for ntpstats.sh? Not sure whether either of them are bothered by the restart of the wireless services.
 
Last edited by a moderator:
This is what I use, turns it off if set to on 'accidently'.
Code:
#!/bin/sh

# make sure WPS is set to off after reboot
if [ "$(nvram get wl0_wps_mode)" != "disabled" ] || [ "$(nvram get wps_enable)" != "0" ] || [ "$(nvram get wps_enable_x)" != "0" ];then
   sleep 5
   logger "WPS has been disabled by $0"
   nvram set wl0_wps_mode=disabled
   nvram set wps_enable=0
   nvram set wps_enable_x=0
   nvram commit
   service restart_wireless
fi
 
In services-start (at the beginning or at the end?) or to run manually as a script?
It turned itself on when it rebooted from the upgrade. Not a big deal for me as my router is powered off a UPS so I don't need to reboot very often.
 
In services-start (at the beginning or at the end?) or to run manually as a script?
I have that in one of the start scripts, and only on the 87U router.
This one seems the most affected.
But it can't hurt having it during boot up if you have it disabled anyway.
It just checks if one of the three settins is on, if so it sets them to off and restarts the service.
 
This is what I use, turns it off if set to on 'accidently'.
Code:
#!/bin/sh

# make sure WPS is set to off after reboot
if [ "$(nvram get wl0_wps_mode)" != "disabled" ] || [ "$(nvram get wps_enable)" != "0" ] || [ "$(nvram get wps_enable_x)" != "0" ];then
   sleep 5
   logger "WPS has been disabled by $0"
   nvram set wl0_wps_mode=disabled
   nvram set wps_enable=0
   nvram set wps_enable_x=0
   nvram commit
   service restart_wireless
fi
I was just wondering, is there any significance to some of the lines being indented (by spaces?) and do they have to be that way? I just copied and pasted your code into my services-start file and it seemed to work after a reboot.
 

Attachments

  • services start screenshot.jpg
    services start screenshot.jpg
    39.3 KB · Views: 642
I was just wondering, is there any significance to some of the lines being indented (by spaces?) and do they have to be that way? I just copied and pasted your code into my services-start file and it seemed to work after a reboot.

From: https://stackoverflow.com/questions/28832899/proper-indentation-of-bash-script:

Indenting is done to clarify your code. Indentations are usually used for loops, if statements, function definitions to make it easy to see what statements are part of that loop or part of the if statement.

And copying and pasting the code in the correct file, rebooting and finding out that 'it just works' was most likely the intention of @thelonelycoder ;)
 
I was just wondering, is there any significance to some of the lines being indented (by spaces?) and do they have to be that way? I just copied and pasted your code into my services-start file and it seemed to work after a reboot.
Cosmetic white space. I use the tab key, others use the space bar.
This is done to better read what you write and group it together in functions, commands, and sequence the code runs.
Nested operations are also increasingly indented to seperate them.

Whitespace before and after is ignored, but not line breaks.
Here the the if clause starts with
if
and ends reversed with
fi

In html this would be the equivalent of <html></html>

Case statements look like this:
case
.......
esac

Welcome to shell scripts!
 
I was just wondering, is there any significance to some of the lines being indented (by spaces?) and do they have to be that way? I just copied and pasted your code into my services-start file and it seemed to work after a reboot.
Here's a screenshot of ab-solution.sh in Notepad++, my preferred code editor, with the line numbers on the left (the red vertical line is the expanded visual function expanse).
The first for script statement has several nested if subroutines and is delimited by
; do
......
done
This code loops through a series of files and checks them.

Then the if [ $entware == 1 ] ... is again a nested if, elseif (elif) construct.

XGUlvFi.png
 
And hitting the bar will get you a tab. (bah-dom-tish!)

(I'll get my coat.)
"Slow clap"
I'll see you around Mr. Merlin.
 

Latest threads

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!
Top