Simple script trouble

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
lewisffc
DD-WRT Novice


Joined: 12 Apr 2011
Posts: 4

PostPosted: Wed Apr 13, 2011 9:09    Post subject: Simple script trouble Reply with quote
Hi,

I have a basic script and all I want it to do is output the result of 'wl ssid'. However since it is in a script and not in the telnet line it doesnt appear to do it. I have currently got something along the lines of
Code:
#!/bin/sh
RESULT = $(telnet wl ssid)
echo $RESULT


I think im pretty close but not quite right.

Cheers
Sponsor
gobbledigook
DD-WRT Guru


Joined: 06 Apr 2009
Posts: 727

PostPosted: Wed Apr 13, 2011 16:06    Post subject: Reply with quote
at the very basic level this should output your SSID in the terminal? although i'm not at home to test...

Code:

#!/bin/sh
wl ssid


chmod +x MY_SCRIPT

./MY_SCRIPT

it will be lost on reboot unless you enable jffs or set a startup script to echo the commands into the file.

you don't need the telnet command, as you should be connected to the router already... although i get the feeling you want to do more with the script than you are letting on Wink please expand on your overall aims...

_________________
Please search the forum and dd-wrt wiki before posting, you may be surprised Wink
useful links:
Optware the right way
list of optware packages
broadcom announcements, peacock and recommended builds
lewisffc
DD-WRT Novice


Joined: 12 Apr 2011
Posts: 4

PostPosted: Thu Apr 14, 2011 19:14    Post subject: Reply with quote
Exactly right, but I can't execute it from the terminal, I needed it to go from the commands in startup to the snmpd.conf file so that it can create an OID for it, then I can access it via my Java program that Ive got running. I did manage to get this issue working, however, I have now another issue which is:

Is it possible to go from a Java program that uses SNMP (either the get/set command) to access an OID that will trigger a script?

For example, if I was running my program and I wanted to change the SSID of the network. Obviously I would like to continue using SNMP commands like I am currently able to do right now so by clicking a button I send information to an OID in the MIB stating this. Could a change in the OID make the program realise there is a change and act accordingly, executing another script to change the SSID to the user inputted value in the OID that was accessed.

Cheers,
Lewis
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware 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