From 98ace523514b38676ba6a9782abee9d15563cc88 Mon Sep 17 00:00:00 2001 From: Bill Zimmerman Date: Mon, 19 Mar 2018 12:43:24 +0100 Subject: [PATCH] bug fixes to default_configuration(). Resolves #174. Thanks @Austin-RR --- installers/common.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index abf488b3..9dc37a89 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -191,15 +191,16 @@ function default_configuration() { # Generate required lines for Rasp AP to place into rc.local file. # #RASPAP is for removal script lines=( - 'echo 1 > /proc/sys/net/ipv4/ip_forward #RASPAP' + 'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP' 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' + ) for line in "${lines[@]}"; do if grep "$line" /etc/rc.local > /dev/null; then echo "$line: Line already added" else - sed -i "s/exit 0/$line\nexit0/" /etc/rc.local + sudo sed -i "s/^exit 0$/$line\nexit 0/" /etc/rc.local echo "Adding line $line" fi done