Skip to content

Commit

Permalink
# v1.0.1 修复 通过脚本修改配置文件中端口后没有保存防火墙设置的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Toyo authored Jun 2, 2017
1 parent 9658fb3 commit de6acf1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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.0
# Version: 1.0.1
# Author: Toyo
# Blog: https://doub.io/vpnzy-7/
#=================================================
sh_ver="1.0.0"
sh_ver="1.0.1"
file="/usr/local/sbin/ocserv"
conf_file="/etc/ocserv"
conf="/etc/ocserv/ocserv.conf"
Expand Down Expand Up @@ -64,6 +64,8 @@ Download_ocserv(){
./configure
make
make install
cd .. && cd ..
rm -rf ocserv/

mkdir "${conf_file}"
wget --no-check-certificate -N -P "${conf_file}" "https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/other/ocserv.conf"
Expand Down Expand Up @@ -198,6 +200,7 @@ Set_ocserv(){
set_udp_port=$(cat ${conf}|grep "udp-port ="|awk -F ' = ' '{print $NF}')
Del_iptables
Add_iptables
Save_iptables
echo "是否重启 ocserv ? (Y/n)"
stty erase '^H' && read -p "(默认: Y):" yn
[[ -z ${yn} ]] && yn="y"
Expand Down Expand Up @@ -430,7 +433,6 @@ Save_iptables(){
}
Set_iptables(){
echo "1" > /proc/sys/net/ipv4/ip_forward
sysctl -p
ifconfig_status=$(ifconfig)
if [[ -z ${ifconfig_status} ]]; then
echo -e "${Error} ifconfig 未安装 !"
Expand Down

0 comments on commit de6acf1

Please sign in to comment.