bug fixes to default_configuration(). Resolves #174. Thanks @Austin-RR

This commit is contained in:
Bill Zimmerman 2018-03-19 12:43:24 +01:00
parent b9bd1cf46f
commit 98ace52351

View file

@ -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