--- /dev/null
+#!/bin/sh
+# network-backdoor.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network-backdoor command
+#
+# valid action are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p" | sed -n "s/%20/ /pg"`
+echo "$ARG"
+/etc/init.d/network-backdoor "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
--- /dev/null
+#!/bin/sh
+# network-static.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network-static command
+#
+# valid action are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p" | sed -n "s/%20/ /pg"`
+echo "$ARG"
+/etc/init.d/network-static "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
--- /dev/null
+#!/bin/sh
+# network.cgi
+# Ian Roberts 15 Sept 2012
+#
+# CGI to return the output from an /etc/init.d/network command
+#
+# valid actions are start, stop, enable, disable
+#
+cat <<EOF
+Content-type: text/html
+
+<html>
+<head>
+<meta http-equiv="cache-control" content="no-cache">
+<meta http-equiv="pragma" content="no-cache">
+<meta http-equiv="expires" content="-1">
+</head>
+<body>
+EOF
+
+ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p" | sed -n "s/%20/ /pg"`
+echo "$ARG"
+/etc/init.d/network "$ARG"
+cat <<EOF
+</body>
+</html>
+EOF
if (dhcp = "no") {
// disable network-state service and endable network service
- downloadUrl("/cgi-bin/setservice.cgi?action=enabledhcp",null);
+ downloadUrl("/cgi-bin/network-static.cgi?action=disable",GenericReturn);
+ downloadUrl("/cgi-bin/network-static.cgi?action=stop",GenericReturn);
+
+ downloadUrl("/cgi-bin/network.cgi?action=enable",GenericReturn);
+ downloadUrl("/cgi-bin/network.cgi?action=start",GenericReturn);
}
else {
// dhcp already running, restart service
- downloadUrl("/cgi-bin/setservice.cgi?action=restartdhcp",null);
+ downloadUrl("/cgi-bin/network.cgi?action=stop",GenericReturn);
+ downloadUrl("/cgi-bin/network.cgi?action=start",GenericReturn);
}
}
else {
if (dhcp = "yes") {
// disable network service and enable network-static service
- downloadUrl("/cgi-bin/setservice.cgi?action=enablestatic",null);
+ downloadUrl("/cgi-bin/network.cgi?action=stop",GenericReturn);
+ downloadUrl("/cgi-bin/network.cgi?action=disable",GenericReturn);
+ downloadUrl("/cgi-bin/network-static.cgi?action=enable",GenericReturn);
}
// change network-static file variables
var new_ = document.network.backdoor.value;
var url = '/cgi-bin/setline.cgi?file=/etc/init.d/network-backup&this=BACKDOOR=&that="' + new_backdoor + '"';
downloadUrl(url,null);
- downloadUrl("/cgi-bin/setservice.cgi?action=restartbackup",null);
+ downloadUrl("/cgi-bin/network-backdoor.cgi?action=stop",null);
+ downloadUrl("/cgi-bin/network-backdoor.cgi?action=start",null);
}
// finally restart network-static service with new parameters
- downloadUrl("/cgi-bin/setservice.cgi?action=restartstatic",null);
+ downloadUrl("/cgi-bin/network-static.cgi?action=stop",GenericReturn);
+ downloadUrl("/cgi-bin/network-static.cgi?action=start",GenericReturn);
}
}