Script to Toggle WiFi

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
moonbug
DD-WRT Novice


Joined: 17 Feb 2010
Posts: 29

PostPosted: Mon May 12, 2014 15:45    Post subject: Script to Toggle WiFi Reply with quote
I tried running the script below but get error /tmp/custom.sh: line 6: mixed: not found

#!/bin/sh
if "`nvram get wl0_net_mode`" = "mixed"; then
nvram set wl0_net_mode="disabled"
else
nvram set wl0_net_mode="mixed"
fi
Sponsor
matth::
DD-WRT Novice


Joined: 13 Sep 2017
Posts: 30

PostPosted: Tue May 15, 2018 22:03    Post subject: Reply with quote
This will work for Linksys WRT3200ACM:

Code:

#!/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


_________________
Router: Linksys WRT3200ACM (DD-WRT enabled)
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions 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 can attach files in this forum
You can download files in this forum