My_Page

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2, 3, ... 24, 25, 26  Next
Author Message
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Sat Nov 28, 2009 0:26    Post subject: Reply with quote
DHC_DarkShadow wrote:
I thought, actually viewing the page in the GUI you could view your scripts.


Maybe it will in the future, I don't see much point in it though.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
Sponsor
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sat Nov 28, 2009 0:33    Post subject: Reply with quote
Eko wrote:
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..)


When I try to view it, I get the blank page and it executes the first script.

_________________
The New Me
Drats
DD-WRT User


Joined: 01 Feb 2007
Posts: 138
Location: Wherever the boat takes me.

PostPosted: Sat Nov 28, 2009 1:32    Post subject: Reply with quote
Works okay on the first script. What would be better is to have multiple tabs for multiple scripts and name the tabs with the name of the script.

Right now I am using it to display the autoap.htm log file on one of my repeaters. GUI for autoap control is next project.

_________________
Ray

Asus RT-N66U B1, AP Router, Merlin Version 3.0.0.4.376.49_4, bl_version=1.0.1.3
Asus WL-500W, DD-WRT v24-sp2 (05/27/14) mini-usb-ftp - build 24160
Buffalo WHR-G54S, Repeater:
_____ broadcom, DD-WRT v24-sp2 (03/29/14) mini - build 23838, AutoAP (2013-10-01)
Buffalo WHR-HP-G54, Repeater:
_____ broadcom, DD-WRT v24-sp2 (03/29/14) mini - build 23838, AutoAP (2013-10-01)
LinkSys WRT54G-V2, Repeater:
_____ broadcom, DD-WRT v24-sp2 (01/17/15) mini - build 25948 , AutoAP (2013-10-01)
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Sat Nov 28, 2009 2:39    Post subject: Reply with quote
DHC_DarkShadow wrote:
Eko wrote:
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..)


When I try to view it, I get the blank page and it executes the first script.


The blank page because you have not written any html code for the page? Smile

_________________
Kernel panic: Aiee, killing interrupt handler!
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Sat Nov 28, 2009 3:29    Post subject: Reply with quote
LOM wrote:
The blank page because you have not written any html code for the page? Smile


So.... I should make script1.sh pull up a HTML page? I am not familiar enough with Linux or scripts, how would I do that?

Code:
#!/bin/sh
directory/webpage.html

_________________
The New Me
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Sat Nov 28, 2009 3:56    Post subject: Reply with quote
DHC_DarkShadow wrote:


So.... I should make script1.sh pull up a HTML page? I am not familiar enough with Linux or scripts, how would I do that?

Code:
#!/bin/sh
directory/webpage.html


According to Eko's post in this thread, you can put a html page in the directory and have it displayed or you can echo outputs from your script.

No echo or no html page - you will only get a blank page, that is how I understand it.

_________________
Kernel panic: Aiee, killing interrupt handler!
Drats
DD-WRT User


Joined: 01 Feb 2007
Posts: 138
Location: Wherever the boat takes me.

PostPosted: Sat Nov 28, 2009 4:47    Post subject: Reply with quote
echo did not work as well as I would have expected. On the other hand, creating an html page and using cat worked like a charm.
Code:
#!/bin/sh
cat Directory/File.htm

_________________
Ray

Asus RT-N66U B1, AP Router, Merlin Version 3.0.0.4.376.49_4, bl_version=1.0.1.3
Asus WL-500W, DD-WRT v24-sp2 (05/27/14) mini-usb-ftp - build 24160
Buffalo WHR-G54S, Repeater:
_____ broadcom, DD-WRT v24-sp2 (03/29/14) mini - build 23838, AutoAP (2013-10-01)
Buffalo WHR-HP-G54, Repeater:
_____ broadcom, DD-WRT v24-sp2 (03/29/14) mini - build 23838, AutoAP (2013-10-01)
LinkSys WRT54G-V2, Repeater:
_____ broadcom, DD-WRT v24-sp2 (01/17/15) mini - build 25948 , AutoAP (2013-10-01)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Sat Nov 28, 2009 4:56    Post subject: Reply with quote
My asterisk status page showed up,but none of the functions worked. I did do a migration to the new Asus RT16N so that may be the problem as well.

Somehow that page in busybox httpd doesn't work either anymore.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Nov 30, 2009 5:41    Post subject: Reply with quote
That page still works in "optware's busybox httpd" but not when I run it in inetd mode as I recently found out. All this only on my new Asus RTN16.

The asterisk page shows up in "MyPage" but none of the functions work. Is it supposed to be able to run shell scripts?

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Mon Nov 30, 2009 6:16    Post subject: Reply with quote
frater wrote:
Is it supposed to be able to run shell scripts?


Yes but I bet you have to adjust the asterisk script, maybe even break it down into sections that can be executed individually. I have never seen the script so I can't really comment on how it works, so I could be way off.

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
frater
DD-WRT Guru


Joined: 07 Jun 2006
Posts: 2777

PostPosted: Mon Nov 30, 2009 7:03    Post subject: Reply with quote
autobot wrote:
frater wrote:
Is it supposed to be able to run shell scripts?


Yes but I bet you have to adjust the asterisk script, maybe even break it down into sections that can be executed individually. I have never seen the script so I can't really comment on how it works, so I could be way off.

If I have to change the script it's easier for me to just continue to use optware's httpd.

_________________
Asus RT16N + OTRW
Kingston 4GB USB-disk 128 MB swap + 1.4GB ext3 on /opt + 2 GB ext3 on /mnt
Copperjet 1616 modem in ZipB-config
Asterisk, pixelserv & Pound running on router
Another Asus RT16N as WDS-bridge

DD-WRT v24-sp2 vpn (c) 2010 NewMedia-NET GmbH
Release: 12/16/10 (SVN revision: 15758M)
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Mon Nov 30, 2009 7:32    Post subject: Reply with quote
Yes but its still nice to have a way to execute scripts on demand from a url.
_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1596

PostPosted: Mon Nov 30, 2009 8:17    Post subject: Reply with quote
Drats wrote:
echo did not work as well as I would have expected. On the other hand, creating an html page and using cat worked like a charm.
Code:
#!/bin/sh
cat Directory/File.htm


You don't have to actually create a html file, try this script to see what I mean.

Code:
 
echo '<title>DD-WRT Wireless Status</title>'
uname -a | cat
uptime | cat
wl status | cat


I'm not going to format it and everything, but you see what I mean.

_________________
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: Mon Nov 30, 2009 12:36    Post subject: Reply with quote
I'll give it a shot after work today.
_________________
The New Me
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Mon Nov 30, 2009 23:57    Post subject: Reply with quote
DHC_DarkShadow wrote:
I'll give it a shot after work today.


My prob was i wasn't awaire that your not supposed to include #!/bin/sh when doing one of these. i got this from another site. Just a little modifing to make it my own and display the info I want.


Code:
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Bash as CGI"
echo "</title></head><body>"

echo "<h1>General system information for host $(hostname -s)</h1>"
echo ""

echo "<h1>Memory Info</h1>"
echo "<pre> $(free -m) </pre>"

echo "<h1>Disk Info:</h1>"
echo "<pre> $(df -h) </pre>"

echo "<h1>Logged in user</h1>"
echo "<pre> $(w) </pre>"

echo "<center>Information generated on $(date)</center>"
echo "</body></html>"

_________________
The New Me
Goto page Previous  1, 2, 3, ... 24, 25, 26  Next Display posts from previous:    Page 2 of 26
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking 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 cannot attach files in this forum
You cannot download files in this forum