// change network-static file variables
- if (document.network.ipaddress.value != ipaddress) {
- var new_ipaddress = document.network.ipaddress.value;
- var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=IPADDRESS=&that="' + new_ipaddress + '"';
- downloadUrl(url,GenericReturn);
- }
+ var new_ipaddress = document.network.ipaddress.value;
+ var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=IPADDRESS=&that="' + new_ipaddress + '"';
+
+ # kick off cascading cgi
+ downloadUrl(url,ipaddressReturn);
- if (document.network.netmask.value != netmask) {
- var new_netmask = document.network.netmask.value;
- var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=NETMASK=&that="' + new_netmask + '"';
- downloadUrl(url,GenericReturn);
- }
- if (document.network.gateway.value != gateway) {
- var new_gateway = document.network.gateway.value;
- var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=GATEWAY=&that="' + new_gateway + '"';
- downloadUrl(url,GenericReturn);
- }
+// if (document.network.backdoor.value != backdoor) {
+// var new_backdoor = document.network.backdoor.value;
+// var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
+// downloadUrl(url,GenericReturn);
+// downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",GenericReturn);
+// }
- if (document.network.dns.value != dns) {
- var new_dns = document.network.dns.value;
- var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=DNS=&that="' + new_dns + '"';
- downloadUrl(url,GenericReturn);
- }
- if (document.network.backdoor.value != backdoor) {
- var new_backdoor = document.network.backdoor.value;
- var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
- downloadUrl(url,GenericReturn);
- downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",GenericReturn);
- }
+ }
+}
- // finally restart network-static service with new parameters
+function ipaddressReturn(doc,status) {
+ loadHtmlTextFile(doc, function(line) {
+ //parseSipShowPeers(line);
+ }
+ );
- downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",GenericReturn);
+ var new_netmask = document.network.netmask.value;
+ var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=NETMASK=&that="' + new_netmask + '"';
+ downloadUrl(url,netmaskReturn);
+}
- }
+function netmaskReturn(doc,status) {
+ loadHtmlTextFile(doc, function(line) {
+ //parseSipShowPeers(line);
+ }
+ );
+
+ var new_gateway = document.network.gateway.value;
+ var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=GATEWAY=&that="' + new_gateway + '"';
+ downloadUrl(url,gatewayReturn);
+}
+
+function gatewayReturn(doc,status) {
+ loadHtmlTextFile(doc, function(line) {
+ //parseSipShowPeers(line);
+ }
+ );
+
+ var new_dns = document.network.dns.value;
+ var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-static&this=DNS=&that="' + new_dns + '"';
+ downloadUrl(url,dnsReturn);
}
+
+function dnsReturn(doc,status) {
+ loadHtmlTextFile(doc, function(line) {
+ //parseSipShowPeers(line);
+ }
+ );
+
+ // finally restart network-static service with new parameters
+
+ downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",GenericReturn);
+}
+
see baps build makefile
http://svn.astfin.org/software/baps/trunk/mini-asterisk-gui.mk
-1. install script fix :enable cgi
+1. install script fix :enable cgi Done
----------------------------------
use sed on /etc/lighttpd.conf
1. Change end bracket to comma
kiss. just copy the corrected conf file from the sourceforge archive.
-2. install script fix :add mini_ext comments to 60xx numbers
+2. install script fix :add mini_ext comments Done
------------------------------------------
use sed on /etc/asterisk/extension.conf
This worked.
-4. network page not working
+4. network page not working Not done
------------------------------
Also how fast can it detect the internet after change in gateway
Try to break internet with dns or gateway changes.
The networking functions have to have synchrous sections, esp when start/stop/enable/disable
For example, u cant do a network start before a network stop has finished?
+
+ Try to synchronise with cascading cgi flow.