Skip to content

Commit

Permalink
# v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo authored Sep 12, 2018
1 parent fa45e2f commit ba802a5
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ocserv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ export PATH
#=================================================
# System Required: Debian/Ubuntu
# Description: ocserv AnyConnect
# Version: 1.0.4
# Version: 1.0.5
# Author: Toyo
# Blog: https://doub.io/vpnzy-7/
#=================================================
sh_ver="1.0.4"
sh_ver="1.0.5"
file="/usr/local/sbin/ocserv"
conf_file="/etc/ocserv"
conf="/etc/ocserv/ocserv.conf"
Expand Down Expand Up @@ -476,20 +476,25 @@ Set_iptables(){
ifconfig_status=$(ifconfig)
if [[ -z ${ifconfig_status} ]]; then
echo -e "${Error} ifconfig 未安装 !"
stty erase '^H' && read -p "请手动输入你的网卡名(一般为 eth0,OpenVZ 虚拟化则为 venet0):" Network_card
stty erase '^H' && read -p "请手动输入你的网卡名(一般情况下,网卡名为 eth0,Debian9 则为 ens3,CentOS Ubuntu 最新版本可能为 enpXsX,OpenVZ 虚拟化则为 venet0):" Network_card
[[ -z "${Network_card}" ]] && echo "取消..." && exit 1
else
Network_card=$(ifconfig|grep "eth0")
if [[ ! -z ${Network_card} ]]; then
Network_card="eth0"
else
Network_card=$(ifconfig|grep "venet0")
Network_card=$(ifconfig|grep "ens3")
if [[ ! -z ${Network_card} ]]; then
Network_card="venet0"
Network_card="ens3"
else
ifconfig
stty erase '^H' && read -p "检测到本服务器的网卡非 eth0 和 venet0 请根据上面输出的网卡信息手动输入你的网卡名:" Network_card
[[ -z "${Network_card}" ]] && echo "取消..." && exit 1
Network_card=$(ifconfig|grep "venet0")
if [[ ! -z ${Network_card} ]]; then
Network_card="venet0"
else
ifconfig
stty erase '^H' && read -p "检测到本服务器的网卡非 eth0 \ ens3(Debian9) \ venet0(OpenVZ) \ enpXsX(CentOS Ubuntu 最新版本),请根据上面输出的网卡信息手动输入你的网卡名:" Network_card
[[ -z "${Network_card}" ]] && echo "取消..." && exit 1
fi
fi
fi
fi
Expand Down

0 comments on commit ba802a5

Please sign in to comment.