Permanently store script in /etc/config for WIFI SES/WPS

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
matth::
DD-WRT Novice


Joined: 13 Sep 2017
Posts: 30

PostPosted: Wed May 16, 2018 17:23    Post subject: Permanently store script in /etc/config for WIFI SES/WPS Reply with quote
Hello folks,

I need your help for my little project.

I wrote a script to turn/toggle on/off wifi on my WRT3200ACM. The script is working until I store it in a folder the system is reading while pressing the SES/AOSS/EZ-SETUP button (the system will look for ".sesbutton" files).

Folders as follows:
/etc/config/
/jffs/etc/config/
/mmc/etc/config/
/tmp/etc/config/

The only folder I can write into/have permissions to write is tmp folder. Since this is a temporary folder the script will be deleted after every reboot.

Did anyone has an idea how to write into the /etc/config or any other of the mentioned folders?

Thank you for your help in advance.

You can take a look at my script on here: https://www.dd-wrt.com/phpBB2/viewtopic.php?p=1128552&highlight=#1128552

Best,
Mike


Sources for my scripts:
https://www.dd-wrt.com/wiki/index.php/Script_Execution

_________________
Router: Linksys WRT3200ACM (DD-WRT enabled)
Sponsor
matth::
DD-WRT Novice


Joined: 13 Sep 2017
Posts: 30

PostPosted: Wed May 16, 2018 21:25    Post subject: Reply with quote
**Edit**

I temporarily discovered a workaround.

Type this in Administration -> Startup

Code:

mkdir /tmp/etc/config
cat <<EOF >/tmp/etc/config/wifi.sesbutton
#!/bin/sh

if [ "`nvram get ath0_net_mode`" = "disabled" ]

   then    stopservice lan

         nvram set ath0_net_mode=acn-mixed

         nvram set ath1_net_mode=ng-only

         startservice lan

      else    stopservice wland

            nvram set ath0_net_mode=disabled

            ifconfig ath0 down

            nvram set ath1_net_mode=disabled

            ifconfig ath1 down

            killall hostapd



fi

EOF

chmod +x /tmp/etc/config/wifi.sesbutton


_________________
Router: Linksys WRT3200ACM (DD-WRT enabled)
matth::
DD-WRT Novice


Joined: 13 Sep 2017
Posts: 30

PostPosted: Thu May 17, 2018 15:51    Post subject: Reply with quote
Hi d0ug,

Thank you for you very useful hint.

I tried this out and now I have permanent storage to store my WIFI script.

It is working like charm.

69.44 MB of usable permanently storage.

Thumbs up!

Best,
Mike

_________________
Router: Linksys WRT3200ACM (DD-WRT enabled)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum