git-svn-id: https://svn.code.sf.net/p/freetel/code@722 01035d8c-6547-0410-b346-abe4f9...
authorhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Sep 2012 00:16:27 +0000 (00:16 +0000)
committerhorse69 <horse69@01035d8c-6547-0410-b346-abe4f91aad63>
Tue, 18 Sep 2012 00:16:27 +0000 (00:16 +0000)
mini-asterisk-gui2/cgi-bin/setservice.cgi

index 584d10a90aa90b41cf9aa5682f95edb236590a92..e97d63ba5b64a3fe430c4c6e02a32e2103309e67 100755 (executable)
@@ -19,13 +19,41 @@ Content-type: text/html
 EOF
 
 ARG=`echo "$QUERY_STRING" | sed -n "s/.*action=//p"`
-echo "$ARG"
+echo "arg is $ARG"
 
 if [ $ARG = "restartstatic" ]; then
-       echo "hi there"
+       echo "restart static"
+       /etc/init.d/network-static stop
+       /etc/init.d/network-static start
+fi
+
+if [ $ARG = "restartbackup" ]; then
+       echo "restartbackup"
+       /etc/init.d/network-backup stop
+       /etc/init.d/network-backup start
+fi
+
+if [ $ARG = "restartdhcp" ]; then
+       echo "restartdhcp"
+       /etc/init.d/network stop
+       /etc/init.d/network start
+fi
+
+if [ $ARG = "enabledhcp" ]; then
+       echo "enabledhcp"
+    /etc/init.d/network-static disable
+    /etc/init.d/network-static stop
+    /etc/init.d/network enable
+    /etc/init.d/network start
+fi
+
+if [ $ARG = "enablestatic" ]; then
+       echo "enable static"
+    /etc/init.d/network stop
+    /etc/init.d/network disable
+    /etc/init.d/network-static enable
 fi
 
-# /etc/init.d/network "$ARG"
 cat <<EOF
 </body>
 </html>