mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 15:40:22 +00:00
bug fixes to default_configuration(). Resolves #174. Thanks @Austin-RR
This commit is contained in:
parent
b9bd1cf46f
commit
98ace52351
1 changed files with 3 additions and 2 deletions
|
@ -191,15 +191,16 @@ function default_configuration() {
|
||||||
# Generate required lines for Rasp AP to place into rc.local file.
|
# Generate required lines for Rasp AP to place into rc.local file.
|
||||||
# #RASPAP is for removal script
|
# #RASPAP is for removal script
|
||||||
lines=(
|
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'
|
'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP'
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for line in "${lines[@]}"; do
|
for line in "${lines[@]}"; do
|
||||||
if grep "$line" /etc/rc.local > /dev/null; then
|
if grep "$line" /etc/rc.local > /dev/null; then
|
||||||
echo "$line: Line already added"
|
echo "$line: Line already added"
|
||||||
else
|
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"
|
echo "Adding line $line"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue