From 07b2e6d07a818c856d404e2c862b631fdd875930 Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 22 Mar 2020 11:47:47 +0000 Subject: [PATCH 1/2] Update stop/start systemd-networkd --- installers/servicestart.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/installers/servicestart.sh b/installers/servicestart.sh index 5f6145e3..d89e044f 100755 --- a/installers/servicestart.sh +++ b/installers/servicestart.sh @@ -58,14 +58,24 @@ if [ -r "$CONFIGFILE" ]; then if [ "${config[BridgedEnable]}" = 1 ]; then if [ "${interface}" = "br0" ]; then + echo "Stopping systemd-networkd" + systemctl stop systemd-networkd + echo "Restarting eth0 interface..." ip link set down eth0 ip link set up eth0 echo "Removing uap0 interface..." iw dev uap0 del + + echo "Restarting systemd-networkd" + systemctl start systemd-networkd + systemctl enable systemd-networkd fi else + echo "Disabling systemd-networkd" + systemctl disable systemd-networkd + echo "Removing br0 interface..." ip link set down br0 ip link del dev br0 From 409545f4c3458c424903f51f0da58d6bdde3835a Mon Sep 17 00:00:00 2001 From: billz Date: Sun, 22 Mar 2020 11:48:33 +0000 Subject: [PATCH 2/2] Direct output to /dev/null, error handling --- installers/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index ef39f5a4..830d40fe 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -291,7 +291,7 @@ function enable_raspap_daemon() { function configure_networking() { install_log "Configuring networking" echo "Enabling IP forwarding" - echo "net.ipv4.ip_forward=1" | sudo tee $raspap_sysctl || install_error "Unable to set IP forwarding" + echo "net.ipv4.ip_forward=1" | sudo tee $raspap_sysctl > /dev/null || install_error "Unable to set IP forwarding" sudo sysctl -p $raspap_sysctl || install_error "Unable to execute sysctl" sudo /etc/init.d/procps restart || install_error "Unable to execute procps" @@ -299,7 +299,7 @@ function configure_networking() { sudo iptables -t nat -A POSTROUTING -j MASQUERADE || install_error "Unable to execute iptables" sudo iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE || install_error "Unable to execute iptables" echo "Persisting IP tables rules" - sudo iptables-save | sudo tee /etc/iptables/rules.v4 + sudo iptables-save | sudo tee /etc/iptables/rules.v4 > /dev/null || install_error "Unable to execute iptables-save" # Prompt to install RaspAP daemon echo -n "Enable RaspAP control service (Recommended)? [Y/n]: "