diff --git a/includes/functions.php b/includes/functions.php index 4a19a0c7..20944244 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -741,77 +741,4 @@ function DisplaySystem(){ /tmp/hostapddata", $return ); - system( "sudo cp /tmp/hostapddata " . RASPI_HOSTAPD_CONFIG, $return ); - - if( $return == 0 ) { - echo "Wifi Hotspot settings saved"; - } else { - echo "Wifi Hotspot settings failed to be saved"; - } - } elseif( isset($_POST['SaveOpenVPNSettings']) ) { - // TODO - } elseif( isset($_POST['SaveTORProxySettings']) ) { - // TODO - } elseif( isset($_POST['StartHotspot']) ) { - echo "Attempting to start hotspot"; - exec( 'sudo /etc/init.d/hostapd start', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } elseif( isset($_POST['StopHotspot']) ) { - echo "Attempting to stop hotspot"; - exec( 'sudo /etc/init.d/hostapd stop', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } elseif( isset($_POST['StartOpenVPN']) ) { - echo "Attempting to start openvpn"; - exec( 'sudo /etc/init.d/openvpn start', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } elseif( isset($_POST['StopOpenVPN']) ) { - echo "Attempting to stop openvpn"; - exec( 'sudo /etc/init.d/openvpn stop', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } elseif( isset($_POST['StartTOR']) ) { - echo "Attempting to start TOR"; - exec( 'sudo /etc/init.d/tor start', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } elseif( isset($_POST['StopTOR']) ) { - echo "Attempting to stop TOR"; - exec( 'sudo /etc/init.d/tor stop', $return ); - foreach( $return as $line ) { - echo $line."
"; - } - } -} ?> - diff --git a/includes/hostapd.php b/includes/hostapd.php index 30517e69..1d7e1408 100755 --- a/includes/hostapd.php +++ b/includes/hostapd.php @@ -175,3 +175,79 @@ function DisplayHostAPDConfig(){ + /tmp/hostapddata", $return ); + system( "sudo cp /tmp/hostapddata " . RASPI_HOSTAPD_CONFIG, $return ); + + if( $return == 0 ) { + echo "Wifi Hotspot settings saved"; + } else { + echo "Wifi Hotspot settings failed to be saved"; + } + } elseif( isset($_POST['SaveOpenVPNSettings']) ) { + // TODO + } elseif( isset($_POST['SaveTORProxySettings']) ) { + // TODO + } elseif( isset($_POST['StartHotspot']) ) { + echo "Attempting to start hotspot"; + exec( 'sudo /etc/init.d/hostapd start', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } elseif( isset($_POST['StopHotspot']) ) { + echo "Attempting to stop hotspot"; + exec( 'sudo /etc/init.d/hostapd stop', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } elseif( isset($_POST['StartOpenVPN']) ) { + echo "Attempting to start openvpn"; + exec( 'sudo /etc/init.d/openvpn start', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } elseif( isset($_POST['StopOpenVPN']) ) { + echo "Attempting to stop openvpn"; + exec( 'sudo /etc/init.d/openvpn stop', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } elseif( isset($_POST['StartTOR']) ) { + echo "Attempting to start TOR"; + exec( 'sudo /etc/init.d/tor start', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } elseif( isset($_POST['StopTOR']) ) { + echo "Attempting to stop TOR"; + exec( 'sudo /etc/init.d/tor stop', $return ); + foreach( $return as $line ) { + echo $line."
"; + } + } +} +?> +