1
0
mirror of synced 2024-11-23 21:36:09 +03:00

Compare commits

..

No commits in common. "9ab949d61d8329c6a9b3326c87d47eba163e7d38" and "1834b792eba104efe4d19b5ddde3d3f6d1253ad2" have entirely different histories.

6 changed files with 18 additions and 72 deletions

View File

@ -197,6 +197,14 @@ check_client_name() {
fi
}
check_iptables() {
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
if [ -x /sbin/iptables ] && ! iptables -nL INPUT >/dev/null 2>&1; then
exiterr "IPTables check failed. Reboot and re-run this script."
fi
fi
}
wait_for_apt() {
count=0
apt_lk=/var/lib/apt/lists/lock
@ -290,6 +298,7 @@ vpnsetup() {
check_dns
check_server_dns
check_client_name
check_iptables
install_pkgs
get_setup_url
run_setup

View File

@ -197,6 +197,14 @@ check_client_name() {
fi
}
check_iptables() {
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
if [ -x /sbin/iptables ] && ! iptables -nL INPUT >/dev/null 2>&1; then
exiterr "IPTables check failed. Reboot and re-run this script."
fi
fi
}
wait_for_apt() {
count=0
apt_lk=/var/lib/apt/lists/lock
@ -290,6 +298,7 @@ vpnsetup() {
check_dns
check_server_dns
check_client_name
check_iptables
install_pkgs
get_setup_url
run_setup

View File

@ -146,17 +146,6 @@ check_client_name() {
fi
}
check_subnets() {
if [ -n "$VPN_L2TP_NET" ] || [ -n "$VPN_L2TP_LOCAL" ] || [ -n "$VPN_L2TP_POOL" ] \
|| [ -n "$VPN_XAUTH_NET" ] || [ -n "$VPN_XAUTH_POOL" ]; then
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
echo "Error: You may only specify custom subnets during initial VPN install." >&2
echo " See Advanced usage -> Customize VPN subnets for more information." >&2
exit 1
fi
fi
}
start_setup() {
bigecho "VPN setup in progress... Please be patient."
mkdir -p /opt/src
@ -568,7 +557,6 @@ vpnsetup() {
check_dns
check_server_dns
check_client_name
check_subnets
check_libreswan
start_setup
install_setup_pkgs

View File

@ -128,17 +128,6 @@ check_client_name() {
fi
}
check_subnets() {
if [ -n "$VPN_L2TP_NET" ] || [ -n "$VPN_L2TP_LOCAL" ] || [ -n "$VPN_L2TP_POOL" ] \
|| [ -n "$VPN_XAUTH_NET" ] || [ -n "$VPN_XAUTH_POOL" ]; then
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
echo "Error: You may only specify custom subnets during initial VPN install." >&2
echo " See Advanced usage -> Customize VPN subnets for more information." >&2
exit 1
fi
fi
}
start_setup() {
bigecho "VPN setup in progress... Please be patient."
mkdir -p /opt/src
@ -583,7 +572,6 @@ vpnsetup() {
check_dns
check_server_dns
check_client_name
check_subnets
check_libreswan
start_setup
install_setup_pkgs

View File

@ -64,17 +64,6 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat 1>&2 <<'EOF'
Error: /dev/ppp is missing. LXC containers require configuration.
See: https://github.com/hwdsl2/setup-ipsec-vpn/issues/1014
EOF
exit 1
fi
}
check_os() {
os_type=centos
rh_file="/etc/redhat-release"
@ -167,17 +156,6 @@ check_client_name() {
fi
}
check_subnets() {
if [ -n "$VPN_L2TP_NET" ] || [ -n "$VPN_L2TP_LOCAL" ] || [ -n "$VPN_L2TP_POOL" ] \
|| [ -n "$VPN_XAUTH_NET" ] || [ -n "$VPN_XAUTH_POOL" ]; then
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
echo "Error: You may only specify custom subnets during initial VPN install." >&2
echo " See Advanced usage -> Customize VPN subnets for more information." >&2
exit 1
fi
fi
}
start_setup() {
bigecho "VPN setup in progress... Please be patient."
mkdir -p /opt/src
@ -716,14 +694,12 @@ EOF
vpnsetup() {
check_root
check_vz
check_lxc
check_os
check_iface
check_creds
check_dns
check_server_dns
check_client_name
check_subnets
check_libreswan
start_setup
install_setup_pkgs

View File

@ -63,17 +63,6 @@ check_vz() {
fi
}
check_lxc() {
# shellcheck disable=SC2154
if [ "$container" = "lxc" ] && [ ! -e /dev/ppp ]; then
cat 1>&2 <<'EOF'
Error: /dev/ppp is missing. LXC containers require configuration.
See: https://github.com/hwdsl2/setup-ipsec-vpn/issues/1014
EOF
exit 1
fi
}
check_os() {
os_type=$(lsb_release -si 2>/dev/null)
[ -z "$os_type" ] && [ -f /etc/os-release ] && os_type=$(. /etc/os-release && printf '%s' "$ID")
@ -165,17 +154,6 @@ check_client_name() {
fi
}
check_subnets() {
if [ -n "$VPN_L2TP_NET" ] || [ -n "$VPN_L2TP_LOCAL" ] || [ -n "$VPN_L2TP_POOL" ] \
|| [ -n "$VPN_XAUTH_NET" ] || [ -n "$VPN_XAUTH_POOL" ]; then
if grep -qs "hwdsl2 VPN script" /etc/sysctl.conf; then
echo "Error: You may only specify custom subnets during initial VPN install." >&2
echo " See Advanced usage -> Customize VPN subnets for more information." >&2
exit 1
fi
fi
}
check_iptables() {
if [ -x /sbin/iptables ] && ! iptables -nL INPUT >/dev/null 2>&1; then
exiterr "IPTables check failed. Reboot and re-run this script."
@ -688,14 +666,12 @@ EOF
vpnsetup() {
check_root
check_vz
check_lxc
check_os
check_iface
check_creds
check_dns
check_server_dns
check_client_name
check_subnets
check_iptables
check_libreswan
start_setup