mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Replace /etc.init.d with service
This commit is contained in:
@@ -35,7 +35,7 @@ function DisplayDHCPConfig() {
|
||||
if ($dnsmasq_state) {
|
||||
$status->addMessage('dnsmasq already running', 'info');
|
||||
} else {
|
||||
exec('sudo /etc/init.d/dnsmasq start', $dnsmasq, $return);
|
||||
exec('sudo service dnsmasq start', $dnsmasq, $return);
|
||||
if ($return == 0) {
|
||||
$status->addMessage('Successfully started dnsmasq', 'success');
|
||||
$dnsmasq_state = true;
|
||||
@@ -49,7 +49,7 @@ function DisplayDHCPConfig() {
|
||||
} elseif( isset($_POST['stopdhcpd'] ) ) {
|
||||
if (CSRFValidate()) {
|
||||
if ($dnsmasq_state) {
|
||||
exec('sudo /etc/init.d/dnsmasq stop', $dnsmasq, $return);
|
||||
exec('sudo service dnsmasq stop', $dnsmasq, $return);
|
||||
if ($return == 0) {
|
||||
$status->addMessage('Successfully stopped dnsmasq', 'success');
|
||||
$dnsmasq_state = false;
|
||||
|
@@ -412,25 +412,25 @@ function SaveTORAndVPNConfig(){
|
||||
// TODO
|
||||
} elseif( isset($_POST['StartOpenVPN']) ) {
|
||||
echo "Attempting to start openvpn";
|
||||
exec( 'sudo /etc/init.d/openvpn start', $return );
|
||||
exec( 'sudo service openvpn start', $return );
|
||||
foreach( $return as $line ) {
|
||||
echo $line."<br />";
|
||||
}
|
||||
} elseif( isset($_POST['StopOpenVPN']) ) {
|
||||
echo "Attempting to stop openvpn";
|
||||
exec( 'sudo /etc/init.d/openvpn stop', $return );
|
||||
exec( 'sudo service openvpn stop', $return );
|
||||
foreach( $return as $line ) {
|
||||
echo $line."<br />";
|
||||
}
|
||||
} elseif( isset($_POST['StartTOR']) ) {
|
||||
echo "Attempting to start TOR";
|
||||
exec( 'sudo /etc/init.d/tor start', $return );
|
||||
exec( 'sudo service tor start', $return );
|
||||
foreach( $return as $line ) {
|
||||
echo $line."<br />";
|
||||
}
|
||||
} elseif( isset($_POST['StopTOR']) ) {
|
||||
echo "Attempting to stop TOR";
|
||||
exec( 'sudo /etc/init.d/tor stop', $return );
|
||||
exec( 'sudo service tor stop', $return );
|
||||
foreach( $return as $line ) {
|
||||
echo $line."<br />";
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ function DisplayHostAPDConfig(){
|
||||
} elseif( isset($_POST['StartHotspot']) ) {
|
||||
if (CSRFValidate()) {
|
||||
$status->addMessage('Attempting to start hotspot', 'info');
|
||||
exec( 'sudo /etc/init.d/hostapd start', $return );
|
||||
exec( 'sudo service hostapd start', $return );
|
||||
foreach( $return as $line ) {
|
||||
$status->addMessage($line, 'info');
|
||||
}
|
||||
@@ -36,7 +36,7 @@ function DisplayHostAPDConfig(){
|
||||
} elseif( isset($_POST['StopHotspot']) ) {
|
||||
if (CSRFValidate()) {
|
||||
$status->addMessage('Attempting to stop hotspot', 'info');
|
||||
exec( 'sudo /etc/init.d/hostapd stop', $return );
|
||||
exec( 'sudo service hostapd stop', $return );
|
||||
foreach( $return as $line ) {
|
||||
$status->addMessage($line, 'info');
|
||||
}
|
||||
|
Reference in New Issue
Block a user