Bash Script for DD-WRT

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


Joined: 19 Nov 2013
Posts: 21
Location: Islamabad,Pakistan

PostPosted: Tue Nov 19, 2013 21:20    Post subject: Bash Script for DD-WRT Reply with quote
Hi I'm new to DD-WRT, can someone please guide me on how to write a bash script which will send a command to DD-WRT to enable/disable QoS , I'm really confused, how to execute this script and how the command will get to the router, i'm using ubuntu 12.04 and DD-WRT v24 on linksys router, please can anyone guide me please....
Sponsor
flopex
DD-WRT Novice


Joined: 12 Nov 2013
Posts: 4

PostPosted: Thu Nov 21, 2013 0:05    Post subject: Example script Reply with quote
For example setting the "admin" user's password

Code:

#!/bin/bash

(

  echo open 192.168.1.1
  sleep 2
  echo "root"
  sleep 1
  echo "admin"
  sleep 3
  echo setuserpasswd admin admin


) | telnet
Namrah
DD-WRT Novice


Joined: 19 Nov 2013
Posts: 21
Location: Islamabad,Pakistan

PostPosted: Fri Nov 22, 2013 8:50    Post subject: Reply with quote
Thank you so much for your reply.
I just run this script on bash shell right?
Also could you tell me the commands to enable QoS, that will be so much help.
Namrah
DD-WRT Novice


Joined: 19 Nov 2013
Posts: 21
Location: Islamabad,Pakistan

PostPosted: Fri Nov 22, 2013 14:22    Post subject: Reply with quote
when i telnet into ddwrt without the bash script it lets me chnge the password with the setuserpasswd command but when i write the script as above,it does not change the password, what seems to be the problem?
flopex
DD-WRT Novice


Joined: 12 Nov 2013
Posts: 4

PostPosted: Fri Nov 22, 2013 17:22    Post subject: Try sleeping after the setuserpasswd command Reply with quote
Code:
#!/bin/bash

(

  echo open 192.168.1.1
  sleep 2
  echo "root"
  sleep 1
  echo "admin"
  sleep 3
  echo setuserpasswd admin admin
  sleep 1

) | telnet
Namrah
DD-WRT Novice


Joined: 19 Nov 2013
Posts: 21
Location: Islamabad,Pakistan

PostPosted: Fri Nov 29, 2013 12:21    Post subject: Reply with quote
Thank you, it worked but when changes are not saved, when i reboot it accepts the previous password. I tried nvram commit but it did not work. any suggestions please.
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