Revert back to using /etc/init.d

Don't change too many things at once.
This commit is contained in:
Joe Haig 2016-10-23 20:08:17 +01:00
parent d089dbfe43
commit 2d992fb4ac
5 changed files with 17 additions and 17 deletions

View File

@ -59,10 +59,10 @@ www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli scan_results
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli scan www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli scan
www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli reconfigure www-data ALL=(ALL) NOPASSWD:/sbin/wpa_cli reconfigure
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf
www-data ALL=(ALL) NOPASSWD:/usr/sbin/service hostapd start www-data ALL=(ALL) NOPASSWD:/etc/init.d/hostapd start
www-data ALL=(ALL) NOPASSWD:/usr/sbin/service hostapd stop www-data ALL=(ALL) NOPASSWD:/etc/init.d/hostapd stop
www-data ALL=(ALL) NOPASSWD:/usr/sbin/service dnsmasq start www-data ALL=(ALL) NOPASSWD:/etc/init.d/dnsmasq start
www-data ALL=(ALL) NOPASSWD:/usr/sbin/service dnsmasq stop www-data ALL=(ALL) NOPASSWD:/etc/init.d/dnsmasq stop
www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf www-data ALL=(ALL) NOPASSWD:/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf
www-data ALL=(ALL) NOPASSWD:/sbin/shutdown -h now www-data ALL=(ALL) NOPASSWD:/sbin/shutdown -h now
www-data ALL=(ALL) NOPASSWD:/sbin/reboot www-data ALL=(ALL) NOPASSWD:/sbin/reboot

View File

@ -35,7 +35,7 @@ function DisplayDHCPConfig() {
if ($dnsmasq_state) { if ($dnsmasq_state) {
$status->addMessage('dnsmasq already running', 'info'); $status->addMessage('dnsmasq already running', 'info');
} else { } else {
exec('sudo service dnsmasq start', $dnsmasq, $return); exec('sudo /etc/init.d/dnsmasq start', $dnsmasq, $return);
if ($return == 0) { if ($return == 0) {
$status->addMessage('Successfully started dnsmasq', 'success'); $status->addMessage('Successfully started dnsmasq', 'success');
$dnsmasq_state = true; $dnsmasq_state = true;
@ -49,7 +49,7 @@ function DisplayDHCPConfig() {
} elseif( isset($_POST['stopdhcpd'] ) ) { } elseif( isset($_POST['stopdhcpd'] ) ) {
if (CSRFValidate()) { if (CSRFValidate()) {
if ($dnsmasq_state) { if ($dnsmasq_state) {
exec('sudo service dnsmasq stop', $dnsmasq, $return); exec('sudo /etc/init.d/dnsmasq stop', $dnsmasq, $return);
if ($return == 0) { if ($return == 0) {
$status->addMessage('Successfully stopped dnsmasq', 'success'); $status->addMessage('Successfully stopped dnsmasq', 'success');
$dnsmasq_state = false; $dnsmasq_state = false;

View File

@ -412,25 +412,25 @@ function SaveTORAndVPNConfig(){
// TODO // TODO
} elseif( isset($_POST['StartOpenVPN']) ) { } elseif( isset($_POST['StartOpenVPN']) ) {
echo "Attempting to start openvpn"; echo "Attempting to start openvpn";
exec( 'sudo service openvpn start', $return ); exec( 'sudo /etc/init.d/openvpn start', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
echo $line."<br />"; echo $line."<br />";
} }
} elseif( isset($_POST['StopOpenVPN']) ) { } elseif( isset($_POST['StopOpenVPN']) ) {
echo "Attempting to stop openvpn"; echo "Attempting to stop openvpn";
exec( 'sudo service openvpn stop', $return ); exec( 'sudo /etc/init.d/openvpn stop', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
echo $line."<br />"; echo $line."<br />";
} }
} elseif( isset($_POST['StartTOR']) ) { } elseif( isset($_POST['StartTOR']) ) {
echo "Attempting to start TOR"; echo "Attempting to start TOR";
exec( 'sudo service tor start', $return ); exec( 'sudo /etc/init.d/tor start', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
echo $line."<br />"; echo $line."<br />";
} }
} elseif( isset($_POST['StopTOR']) ) { } elseif( isset($_POST['StopTOR']) ) {
echo "Attempting to stop TOR"; echo "Attempting to stop TOR";
exec( 'sudo service tor stop', $return ); exec( 'sudo /etc/init.d/tor stop', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
echo $line."<br />"; echo $line."<br />";
} }

View File

@ -26,7 +26,7 @@ function DisplayHostAPDConfig(){
} elseif( isset($_POST['StartHotspot']) ) { } elseif( isset($_POST['StartHotspot']) ) {
if (CSRFValidate()) { if (CSRFValidate()) {
$status->addMessage('Attempting to start hotspot', 'info'); $status->addMessage('Attempting to start hotspot', 'info');
exec( 'sudo service hostapd start', $return ); exec( 'sudo /etc/init.d/hostapd start', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
$status->addMessage($line, 'info'); $status->addMessage($line, 'info');
} }
@ -36,7 +36,7 @@ function DisplayHostAPDConfig(){
} elseif( isset($_POST['StopHotspot']) ) { } elseif( isset($_POST['StopHotspot']) ) {
if (CSRFValidate()) { if (CSRFValidate()) {
$status->addMessage('Attempting to stop hotspot', 'info'); $status->addMessage('Attempting to stop hotspot', 'info');
exec( 'sudo service hostapd stop', $return ); exec( 'sudo /etc/init.d/hostapd stop', $return );
foreach( $return as $line ) { foreach( $return as $line ) {
$status->addMessage($line, 'info'); $status->addMessage($line, 'info');
} }

View File

@ -58,7 +58,7 @@ function enable_php_lighttpd() {
install_log "Enabling PHP for lighttpd" install_log "Enabling PHP for lighttpd"
sudo lighty-enable-mod fastcgi-php || install_error "Cannot enable fastcgi-php for lighttpd" sudo lighty-enable-mod fastcgi-php || install_error "Cannot enable fastcgi-php for lighttpd"
sudo service lighttpd restart || install_error "Unable to restart lighttpd" sudo /etc/init.d/lighttpd restart || install_error "Unable to restart lighttpd"
} }
# Verifies existence and permissions of RaspAP directory # Verifies existence and permissions of RaspAP directory
@ -134,10 +134,10 @@ function patch_system_files() {
sudo_add '/sbin/wpa_cli scan' sudo_add '/sbin/wpa_cli scan'
sudo_add '/sbin/wpa_cli reconfigure' sudo_add '/sbin/wpa_cli reconfigure'
sudo_add '/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf' sudo_add '/bin/cp /tmp/hostapddata /etc/hostapd/hostapd.conf'
sudo_add '/usr/sbin/service hostapd start' sudo_add '/etc/init.d/hostapd start'
sudo_add '/usr/sbin/service hostapd stop' sudo_add '/etc/init.d/hostapd stop'
sudo_add '/usr/sbin/service dnsmasq start' sudo_add '/etc/init.d/dnsmasq start'
sudo_add '/usr/sbin/service dnsmasq stop' sudo_add '/etc/init.d/dnsmasq stop'
sudo_add '/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf' sudo_add '/bin/cp /tmp/dhcpddata /etc/dnsmasq.conf'
sudo_add '/sbin/shutdown -h now' sudo_add '/sbin/shutdown -h now'
sudo_add '/sbin/reboot' sudo_add '/sbin/reboot'