Update orangepi-config
This commit is contained in:
parent
cbface3801
commit
5c94bef426
|
|
@ -23,7 +23,7 @@ fi
|
||||||
#
|
#
|
||||||
# check for internet connection to install dependencies
|
# check for internet connection to install dependencies
|
||||||
#
|
#
|
||||||
wget -q --spider http://github.com
|
wget -q --spider www.baidu.com
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
read -n 1 -s -p "Warning: Configuration cannot work properly without a working internet connection. \
|
read -n 1 -s -p "Warning: Configuration cannot work properly without a working internet connection. \
|
||||||
Press CTRL C to stop or any key to ignore and continue."
|
Press CTRL C to stop or any key to ignore and continue."
|
||||||
|
|
|
||||||
|
|
@ -562,7 +562,7 @@ function get_wlan_interface ()
|
||||||
else
|
else
|
||||||
exec 3>&1
|
exec 3>&1
|
||||||
WIRELESS_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
|
WIRELESS_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
|
||||||
--title "Select interface" --clear --menu "" $((6+${LIST_LENGTH})) 40 15 "${LIST[@]}" 2>&1 1>&3)
|
--title "Select wlan interface" --clear --menu "" $((6+${LIST_LENGTH})) 40 15 "${LIST[@]}" 2>&1 1>&3)
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -642,7 +642,7 @@ function select_default_interface ()
|
||||||
else
|
else
|
||||||
exec 3>&1
|
exec 3>&1
|
||||||
DEFAULT_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
|
DEFAULT_ADAPTER=$(dialog --nocancel --backtitle "$BACKTITLE" --no-collapse \
|
||||||
--title "Select $1 interface" --clear --menu "" $((6+${LIST_LENGTH})) 74 14 "${LIST[@]}" 2>&1 1>&3)
|
--title "Select default interface" --clear --menu "" $((6+${LIST_LENGTH})) 74 14 "${LIST[@]}" 2>&1 1>&3)
|
||||||
exec 3>&-
|
exec 3>&-
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -649,6 +649,9 @@ function jobs ()
|
||||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||||
# Clear iptables
|
# Clear iptables
|
||||||
iptables-save | awk '/^[*]/ { print $1 } /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; } /COMMIT/ { print $0; }' | iptables-restore
|
iptables-save | awk '/^[*]/ { print $1 } /^:[A-Z]+ [^-]/ { print $1 " ACCEPT" ; } /COMMIT/ { print $0; }' | iptables-restore
|
||||||
|
if [[ ${DISTRIBUTION_CODENAME} == buster ]]; then
|
||||||
|
echo 1 | update-alternatives --config iptables > /dev/null
|
||||||
|
fi
|
||||||
# - Apply iptables
|
# - Apply iptables
|
||||||
iptables -t nat -A POSTROUTING -o $DEFAULT_ADAPTER -j MASQUERADE
|
iptables -t nat -A POSTROUTING -o $DEFAULT_ADAPTER -j MASQUERADE
|
||||||
iptables -A FORWARD -i $DEFAULT_ADAPTER -o $WIRELESS_ADAPTER -m state --state RELATED,ESTABLISHED -j ACCEPT
|
iptables -A FORWARD -i $DEFAULT_ADAPTER -o $WIRELESS_ADAPTER -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue