From ea36aa9d06c9e4e6924b826d52147937a5b6d9dc Mon Sep 17 00:00:00 2001 From: dman776 Date: Thu, 18 Oct 2018 11:06:55 -0500 Subject: [PATCH] feature: add a "firstboot" button on setup page (#225) * feature: add a "firstboot" button on setup page fixes #162 * changed confirmation message --- files/www/cgi-bin/perlfunc.pm | 5 +++-- files/www/cgi-bin/setup | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/files/www/cgi-bin/perlfunc.pm b/files/www/cgi-bin/perlfunc.pm index 0484f0d5..9d195c0b 100644 --- a/files/www/cgi-bin/perlfunc.pm +++ b/files/www/cgi-bin/perlfunc.pm @@ -306,6 +306,7 @@ sub reboot_page my ($link) = @_; my($lanip, $lanmask, $junk, $lannet); my $node = nvram_get("node"); + $node = "Node" if $node eq ""; $link = "/cgi-bin/status" unless $link; # is the browser coming from the lan? @@ -348,8 +349,8 @@ sub reboot_page print "

$node is rebooting


\n"; print "

Your browser should return to this node in 60 seconds.

\n"; print "If something goes astray you can try to connect with

"; - print "http://localnode.local.mesh:8080/
or
\n"; - print "http://$node.local.mesh:8080/

\n"; + print "http://localnode.local.mesh:8080/
\n"; + print "or
http://$node.local.mesh:8080/\n" if $node ne "Node"; } print ""; diff --git a/files/www/cgi-bin/setup b/files/www/cgi-bin/setup index 8a1dd448..966a931b 100755 --- a/files/www/cgi-bin/setup +++ b/files/www/cgi-bin/setup @@ -453,6 +453,13 @@ if($parms{button_save}) } system "rm -rf /tmp/web/save"; + +if($parms{button_firstboot}) +{ + system "firstboot -y"; + reboot_page("/cgi-bin/status"); +} + reboot_page("/cgi-bin/status") if $parms{button_reboot}; # @@ -577,6 +584,7 @@ print "     +  \n";