My_Page

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2, 3 ... 23, 24, 25  Next
Author Message
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Nov 26, 2009 14:23    Post subject: My_Page Reply with quote
Wiki = My page Tutorial

Files = Page 5 post



Anyone know any info on how to get to this or what build/version it's in?

By looking at the timeline, it looks like a page to have custom scripts on.

_________________
The New Me


Last edited by DHC_DarkShadow on Thu Apr 29, 2010 21:38; edited 2 times in total
Sponsor
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Thu Nov 26, 2009 16:37    Post subject: Reply with quote
Yep... it is in my latest builds.

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.

Play with it....
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Nov 26, 2009 18:04    Post subject: Reply with quote
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
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Thu Nov 26, 2009 22:43    Post subject: Reply with quote
DHC_DarkShadow wrote:
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)
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Thu Nov 26, 2009 23:47    Post subject: Reply with quote
cool thanks, I'll give it a try when I get home.
_________________
The New Me
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Fri Nov 27, 2009 3:29    Post subject: Reply with quote
DHC_DarkShadow wrote:
cool thanks, I'll give it a try when I get home.


Whats the command to remove a nvram setting?

I misspelled scrpt Laughing

_________________
The New Me
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7632

PostPosted: Fri Nov 27, 2009 3:41    Post subject: Reply with quote
nvram set variablename or maybe it was nvram set variablename=
_________________
Kernel panic: Aiee, killing interrupt handler!
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Fri Nov 27, 2009 3:56    Post subject: Reply with quote
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)
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Fri Nov 27, 2009 4:26    Post subject: Reply with quote
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 New Me
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Fri Nov 27, 2009 5:04    Post subject: Reply with quote
DHC_DarkShadow wrote:
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)
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Fri Nov 27, 2009 5:27    Post subject: Reply with quote
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
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Fri Nov 27, 2009 23:33    Post subject: Reply with quote
+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

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Fri Nov 27, 2009 23:57    Post subject: Reply with quote
Ok here is how it works.

1. Say you have two scripts name ifupdown.sh and wget.sh, and your scripts are in /mmc

2. You set the nvram variable like:
nvram set mypage_scripts="/mmc/ifupdown.sh /mmc/wget.sh"

3. You would now be able to execute ifupdown.sh by browsing to http://routerip/MyPage.asp?1

4. You would now be able to execute wget.sh by browsing to http://routerip/MyPage.asp?2

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

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sat Nov 28, 2009 0:02    Post subject: Reply with quote
If someone could add that to the wiki it should help out people.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
DHC_DarkShadow
DD-WRT Guru


Joined: 22 Jun 2008
Posts: 2440
Location: Am now Dark_Shadow

PostPosted: Sat Nov 28, 2009 0:03    Post subject: Reply with quote
I thought, actually viewing the page in the GUI you could view your scripts.
_________________
The New Me
Goto page 1, 2, 3 ... 23, 24, 25  Next Display posts from previous:    Page 1 of 25
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