From 04d6eb622fa6df3c535e9405397b6a17f91fb685 Mon Sep 17 00:00:00 2001 From: necro-nemesis Date: Sun, 15 Sep 2019 08:22:35 -0400 Subject: [PATCH] Remove deprecated PHP install update to 7.0 --- installers/common.sh | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 0d8fa3b..20736a4 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -7,17 +7,18 @@ version=`sed 's/\..*//' /etc/debian_version` # php package to install if [ $version -eq 10 ]; then version_msg="Raspbian 10.0 (Buster)" + sudo apt update --allow-releaseinfo-change php_package="php7.1-cgi" elif [ $version -eq 9 ]; then version_msg="Raspbian 9.0 (Stretch)" php_package="php7.0-cgi" elif [ $version -eq 8 ]; then version_msg="Raspbian 8.0 (Jessie)" - php_package="php5-cgi" + php_package="php7.0-cgi" else version_msg="Raspbian earlier than 8.0 (Wheezy)" webroot_dir="/var/www" - php_package="php5-cgi" + php_package="php7.0-cgi" fi phpcgiconf="" @@ -214,13 +215,24 @@ function default_configuration() { sudo chmod 755 /var/lib/lokinet/lokilaunch.sh # Generate required lines for Rasp AP to place into rc.local file. - # #RASPAP is for removal script + # #RASPAP is for removal + # select iptables or nftables + + function networktables() { + if [ ! -f /usr/sbin/iptables-nft ]; then + tablerouteA='iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP' + tablerouteB='iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' + else + sudo apt-get -y install nftables + tablerouteA='nft add rule ip nat POSTROUTING oifname "lokitun0" ip saddr 10.3.141.0\/24 counter masquerade #RASPAP' + tablerouteB='nft add rule ip nat POSTROUTING counter masquerade #RASPAP' + } + lines=( - 'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP' - 'iptables -t nat -A POSTROUTING -s 10.3.141.0\/24 -o lokitun0 -j MASQUERADE #RASPAP' - 'iptables -t nat -A POSTROUTING -j MASQUERADE #RASPAP' + 'echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward #RASPAP') + $tablerouteA + $tablerouteB 'sudo \/var\/lib\/lokinet\/.\/lokilaunch.sh start #RASPAP' - ) for line in "${lines[@]}"; do