When you set this mypage_scripts nvram variable to point to your script(s), it will run the script when you call it. It will also show on routers GUI (under status..)
If you call it without parameters, it will run first script in list.
But calling it with parameter, like MyPage.asp?3 it will run e.g. 3rd script in list.
Scripts should be like this:
Whatever you echo in the script, it will show on MyPage page then. You can do full html with it too.
Joined: 22 Jun 2008 Posts: 2440 Location: Am now Dark_Shadow
Posted: Thu Nov 26, 2009 18:04 Post subject:
Say I put my script files in say /mmc/data/scripts I would set it like this?
Code:
nvram set mypage_scripts="/mmc/data/scripts"
EDIT: I added this line to my rc_startup, When I click om the MyPage tab, I get "sh: /mmc/data/scripts: permission denied" in serial output. _________________ The New Me
Say I put my script files in say /mmc/data/scripts I would set it like this?
Code:
nvram set mypage_scripts="/mmc/data/scripts"
EDIT: I added this line to my rc_startup, When I click om the MyPage tab, I get "sh: /mmc/data/scripts: permission denied" in serial output.
You don't need to have it in your startup script, the mypage_scripts nvram variable will survive reboots like any other nvram variable as long as you do a nvram commit after you change it. You need to list them individual like this:
nvram set mypage_scripts="/mmc/data/scripts/script1.sh /mmc/data/scripts/script2.sh /mmc/data/scripts/script3.sh"
nvram commit _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
nvram unset [variable] _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Is it a requirement that the names be "script1.sh....2.sh..etc"?
EDIT: I am still getting permission denied in serial and a blank page in the gui when i click Status-->My Page
The variable would be kind of pointless if they had to have specific names... Name them whatever you want, you just need to have the path to each script in the nvram variable, not a directory containing scripts.
Have you done the obvious thing and gave them all execute permission? If so, then did you try with chmod 777 for full permissions? _________________ Read the forum announcements thoroughly! Be cautious if you're inexperienced.
Available for paid consulting. (Don't PM about complicated setups otherwise)
Looking for bricks and spare routers to expand my collection. (not interested in G spec models)
Joined: 22 Jun 2008 Posts: 2440 Location: Am now Dark_Shadow
Posted: Fri Nov 27, 2009 5:27 Post subject:
The permission thing did the trick, but when i click on MyPage in the GUI it tries to execute the scripts. I thought you could view them from there, then type in the URL address 192.168.1.1/MyPage.asp?1 and it would run script one.
Maybe i should wait for someone with a little more knowledge to mess around with it and give a tut. _________________ The New Me
+1 on how to get this to work, I know permissions, bash, etc..etc and still can't get anything other than a blank MyPage.asp _________________ Eko Builds
The numbers correspond to the order you put the scripts in nvram, there will be no output from http://routerip/MyPage.asp?1 as it just executes your script. _________________ Eko Builds