My_Page

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


Joined: 07 May 2009
Posts: 1593

PostPosted: Tue Dec 01, 2009 1:12    Post subject: Reply with quote
DHC_DarkShadow wrote:

Code:
echo "Content-type: text/html"
echo ""
echo "<html><head><title>router: $(hostname -s)"


Would be a more informative title.

Its a nice feature and I am loving it, but I have been doing this with haserl for a while and like it better as you can have bash inside your html instead of the other way round. But still, I can use this in so many ways and I thank you Eko for including this elegant piece of code.

_________________
Eko Builds

BrainSlayer Builds

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


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Tue Dec 01, 2009 1:56    Post subject: Reply with quote
Here's some basic navigation you can throw into your scripts which will create a list of links to all your mypage_scripts and displays the path to them.

n=1;for i in $(nvram get mypage_scripts); do echo "<a href=\"MyPage.asp?$n\">$i</a>";let n+=1; done

_________________
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)
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1593

PostPosted: Tue Dec 01, 2009 4:23    Post subject: Reply with quote
phuzi0n wrote:
Here's some basic navigation you can throw into your scripts which will create a list of links to all your mypage_scripts and displays the path to them.

n=1;for i in $(nvram get mypage_scripts); do echo "<a href=\"MyPage.asp?$n\">$i</a>";let n+=1; done


Nice addition phuzi0n.

_________________
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: Tue Dec 01, 2009 4:45    Post subject: Reply with quote
This is what I got so far. Now granted my knowledge of this stuff is very limited, so I am open to any suggestion. I would love to know some of the stuff you guys are using. I only have one script. Not sure what I can and can't do for the others.

Code:
echo "<html><head><title>router: $(hostname -s)</title></head><body>"

n=1;for i in $(nvram get mypage_scripts); do echo "<a href=\"MyPage.asp?$n\">$i</a>";let n+=1; done

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

echo "<h1>UPTime</h1>"
echo "<pre> $(uptime) </pre>"

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

echo "<h1>Mount Info</h1>"
echo "<pre> $(mount) </pre>"

echo "<h1>Wireless Status</h1>"
echo "<pre> $(wl status | cat) </pre>"

echo "<h1>CoreREV</h1>"
echo "<pre> $(nvram get wl0_corerev) </pre>"

echo "<h1>Wireless Capabilities</h1>"
echo "<pre> $(wl cap) </pre>"

echo "<h1>uname Status</h1>"
echo "<pre> $(uname -a | cat) </pre>"

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

_________________
The New Me
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1593

PostPosted: Tue Dec 01, 2009 7:14    Post subject: Reply with quote
Here is one that has a table around it, and yes it works without echo like that.

Code:

"Content-type: text/html"
"<html><head><title>router: $(hostname -s)"
"</title></head><body>"
echo "<table border cellspacing="3" cellpadding="8" width="80%" align="center">"
echo "<h1>Information on router: ($(hostname -s))</h1>"
echo ""
echo "<td>"
echo "<h1>Uptime</h1>"
echo "<pre> $(uptime) </pre>"
echo "<h1>Wireless Info</h1>"
echo "<pre> $(wl status) </pre>"
echo "<h1>Memory</h1>"
echo "<pre> $(free) </pre>"
echo "<h1>Disk</h1>"
echo "<pre> $(df -h) </pre>"
echo "<h1>Processes</h1>"
echo "<pre> $(ps) </pre>"
echo "<h1>Cpu</h1>"
echo "<pre> $(cat /proc/cpuinfo) </pre>"
echo "</td>"
echo "<center>-=| $(date) |=-</center>"
echo "</body></html>"

_________________
Eko Builds

BrainSlayer Builds

DD-WRT Changelog RSS Feed
Eko
DD-WRT Developer/Maintainer


Joined: 07 Jun 2006
Posts: 5772

PostPosted: Tue Dec 01, 2009 7:29    Post subject: Reply with quote
Nice... maybe we can set up little competition for best (looking/useful/funny/stupid/...) MyPage Smile
_________________
Professional debrick service for EU countries for small fee.
Send inquiries to: debrick at dd-wrt dot si

Have a brick you don't need?

Paypal & Amazon.com gift cards are welcome. Every $ or € counts. Email: donate at dd-wrt dot si
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1593

PostPosted: Tue Dec 01, 2009 7:31    Post subject: Reply with quote
Eko wrote:
Nice... maybe we can set up little competition for best (looking/useful/funny/stupid/...) MyPage Smile


I thought the same thing, this is a useful feature that needs to get some love from the scripters.

_________________
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: Tue Dec 01, 2009 8:52    Post subject: Reply with quote
autobot wrote:
Eko wrote:
Nice... maybe we can set up little competition for best (looking/useful/funny/stupid/...) MyPage Smile


I thought the same thing, this is a useful feature that needs to get some love from the scripters.


I couldn't agree more.

_________________
The New Me
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Tue Dec 01, 2009 9:44    Post subject: Reply with quote
autobot wrote:
I thought the same thing, this is a useful feature that needs to get some love from the scripters.

It's mainly just reimplementing CGI access that was removed to fix the miliworm exploit. Having it in the GUI does make it stand out a lot more though.

_________________
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)
autobot
DD-WRT Guru


Joined: 07 May 2009
Posts: 1593

PostPosted: Tue Dec 01, 2009 12:40    Post subject: Reply with quote
phuzi0n wrote:
autobot wrote:
I thought the same thing, this is a useful feature that needs to get some love from the scripters.

It's mainly just reimplementing CGI access that was removed to fix the miliworm exploit. Having it in the GUI does make it stand out a lot more though.


I haven't seen any cgi other than autoap though, I know there is some cool things that can be done with nc and such....I'm trying to figure out how to use GET and POST so we can use forms.

_________________
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: Tue Dec 01, 2009 13:10    Post subject: Reply with quote
What I got so far. kinda a menu setup.

Code:
"Content-type: text/html"
"<html><head><title>router: $(hostname -s)"
"</title></head><body>"
background="http://www.darkhaven.org/images/WhiteBM1.jpg"
echo "<table border cellspacing="3" cellpadding="8" width="80%" align="center">"
echo "<h1>Information on router: ($(hostname -s))</h1>"
echo ""
echo "<td>"
n=1;for i in $(nvram get mypage_scripts); do echo "<a href=\"MyPage.asp?$n\">$i</a>";let n+=1; done
echo "<br><a href=\"index.asp\">Setup</a>"
echo "<a href=\"Wireless_Basic.asp\">Wireless</a>"
echo "<a href=\"Services.asp\">Services</a>"
echo "<a href=\"Firewall.asp\">Security</a>"
echo "<a href=\"Filters.asp\">Access Restrictions</a>"
echo "<a href=\"ForwardSpec.asp\">NAT/QoS</a>"
echo "<a href=\"Management.asp\">Administration</a>"
echo "<a href=\"Status_Router.asp\">Status</a>"
echo "<a href=\"Info.htm\">Sys-Info</a>"
echo "<h1>Uptime</h1>"
echo "<pre> $(uptime) </pre>"
echo "<h1>Memory</h1>"
echo "<pre> $(free) </pre>"
echo "<h1>Processes</h1>"
echo "<pre> $(ps) </pre>"
echo "<h1>Cpu</h1>"
echo "<pre> $(cat /proc/cpuinfo) </pre>"
echo "</td>"
echo "<center>-=| $(date) |=-</center>"
echo "</body></html>"




How would you go about putting in a background image?

_________________
The New Me
Luniz2k1
DD-WRT Guru


Joined: 04 Oct 2007
Posts: 1250
Location: Ohio USA

PostPosted: Tue Dec 01, 2009 14:04    Post subject: Reply with quote
<body background=\"image.ext\">
_________________
(12/24/13) mega - 23204
4x WRT54G-TM

(12/24/13) std - 23204
1x WHR-G300N

(04/15/13) nokaid - 14929
1x WRT54GL v1.1

(07/24/13) micro - 22118
1x WG602v3

Got OpenDNS?
DHC_DarkShadow
DD-WRT Guru


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

PostPosted: Tue Dec 01, 2009 14:11    Post subject: Reply with quote
Luniz2k1 wrote:
<body background=\"image.ext\">


Enhanced

Code:
echo "<body background=\"http://www.mydomain.com/images/image.ext\">"

_________________
The New Me
phuzi0n
DD-WRT Guru


Joined: 10 Oct 2006
Posts: 10143

PostPosted: Tue Dec 01, 2009 21:51    Post subject: Reply with quote
DHC_DarkShadow wrote:
Luniz2k1 wrote:
<body background=\"image.ext\">


Enhanced

Code:
echo "<body background=\"http://www.mydomain.com/images/image.ext\">"

You'll probably want to host it on the router itself in which case you need to put the image in /tmp/www and in your html use the /user path.

#router filesystem path
/tmp/www/image.png

#http path
http://[router ip]/user/image.png

#script code
echo "<img src='user/image.png'>"

_________________
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: Tue Dec 01, 2009 22:54    Post subject: Reply with quote
[quote="phuzi0n"]
DHC_DarkShadow wrote:

You'll probably want to host it on the router itself in which case you need to put the image in /tmp/www and in your html use the /user path.

#router filesystem path
/tmp/www/image.png

#http path
http://[router ip]/user/image.png

#script code
echo "<img src='user/image.png'>"


My domain is hosted on my server pc. but yes for most it should be on the router itself.

_________________
The New Me
Goto page Previous  1, 2, 3, 4 ... 22, 23, 24  Next Display posts from previous:    Page 3 of 24
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