mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Bugfix IP forwarding + error handling
This commit is contained in:
parent
1f538d4a77
commit
6e713e6857
@ -227,8 +227,8 @@ function check_for_old_configs() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f $raspap_sysctl ]; then
|
if [ -f $raspap_sysctl ]; then
|
||||||
sudo cp $raspap_sysctl "$raspap_dir/backups/rc.local.`date +%F-%R`"
|
sudo cp $raspap_sysctl "$raspap_dir/backups/sysctl.d.`date +%F-%R`"
|
||||||
sudo ln -sf "$raspap_dir/backups/rc.local.`date +%F-%R`" "$raspap_dir/backups/rc.local"
|
sudo ln -sf "$raspap_dir/backups/sysctl.d.`date +%F-%R`" "$raspap_dir/backups/sysctl.d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for file in /etc/systemd/network/raspap-*.net*; do
|
for file in /etc/systemd/network/raspap-*.net*; do
|
||||||
@ -277,19 +277,12 @@ function default_configuration() {
|
|||||||
if [ ! -f $raspap_sysctl ]; then
|
if [ ! -f $raspap_sysctl ]; then
|
||||||
echo "Enabling IP forwarding"
|
echo "Enabling IP forwarding"
|
||||||
sudo touch $raspap_sysctl || install_error "Unable to create ${raspap_sysctl}"
|
sudo touch $raspap_sysctl || install_error "Unable to create ${raspap_sysctl}"
|
||||||
|
sudo echo "net.ipv4.ip_forward = 1" >> $raspap_sysctl || install_error "Unable to append to ${raspap_sysctl}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
line='echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward'
|
echo "Enabling persistent IP tables rules"
|
||||||
if grep "$line" $raspap_sysctl > /dev/null; then
|
|
||||||
echo "$line: Line already added"
|
|
||||||
else
|
|
||||||
sudo sed -i "s/^exit 0$/$line\nexit 0/" $raspap_sysctl
|
|
||||||
echo "Adding line $line to $raspap_sysctl"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Applying persistent IP tables rules"
|
|
||||||
if [ ! -f "/etc/iptables/iptables.rules" ]; then
|
if [ ! -f "/etc/iptables/iptables.rules" ]; then
|
||||||
sudo cp $webroot_dir/installers/iptables.rules /etc/iptables
|
sudo cp $webroot_dir/installers/iptables.rules /etc/iptables || install_error "Unable to move iptables.rules to /etc/iptables"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/etc/systemd/system/iptables.service" ]; then
|
if [ ! -f "/etc/systemd/system/iptables.service" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user