mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-31 20:25:13 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,3 @@
|
||||
|
||||
config softether
|
||||
option enable '0'
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2015 OpenWrt-dist
|
||||
# Copyright (C) 2016 Chen RuiWei <crwbak@gmail.com>
|
||||
# Copyright (C) 2018-2019 Lienol
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
START=99
|
||||
STOP=10
|
||||
|
||||
CONFIG=softethervpn
|
||||
|
||||
get_config()
|
||||
{
|
||||
config_get_bool enable $1 enable 0
|
||||
}
|
||||
|
||||
uci_get_by_type() {
|
||||
local index=0
|
||||
if [ -n $4 ]; then
|
||||
index=$4
|
||||
fi
|
||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
||||
echo ${ret:=$3}
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
config_load softethervpn
|
||||
config_foreach get_config softether
|
||||
[ $enable -ne 1 ] && exit 0
|
||||
logger -t 'softethervpn' "Starting softether vpnserver service."
|
||||
/usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver start > /dev/null 2>&1
|
||||
fw3 reload
|
||||
}
|
||||
|
||||
stop()
|
||||
{
|
||||
logger -t 'softethervpn' "Stopping softether vpnserver service."
|
||||
/usr/bin/env LANG=en_US.UTF-8 /usr/libexec/softethervpn/vpnserver stop > /dev/null 2>&1
|
||||
fw3 reload
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete firewall.softethervpn
|
||||
set firewall.softethervpn=include
|
||||
set firewall.softethervpn.type=script
|
||||
set firewall.softethervpn.path=/usr/share/softethervpn/firewall.include
|
||||
set firewall.softethervpn.reload=1
|
||||
EOF
|
||||
|
||||
/etc/init.d/softethervpnbridge disable && /etc/init.d/softethervpnbridge stop
|
||||
/etc/init.d/softethervpnclient disable && /etc/init.d/softethervpnclient stop
|
||||
/etc/init.d/softethervpnserver disable && /etc/init.d/softethervpnserver stop
|
||||
|
||||
chmod a+x /usr/share/softethervpn/* >/dev/null 2>&1
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-softethervpn": {
|
||||
"description": "Grant UCI access for luci-app-softethervpn",
|
||||
"read": {
|
||||
"uci": [ "softethervpn" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "softethervpn" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
openvpnport=$(cat /usr/libexec/softethervpn/vpn_server.config 2>/dev/null|grep OpenVPN_UdpPortList | awk -F " " '{print $3}')
|
||||
[ -z "$openvpnport" ] && openvpnport=1194
|
||||
iptables -D INPUT -p udp -m multiport --dports 500,1701,4500 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
[ -n "$openvpnport" ] && iptables -D INPUT -p udp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
[ -n "$openvpnport" ] && iptables -D INPUT -p tcp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 443 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 5555 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 8888 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -D INPUT -p tcp --dport 992 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
|
||||
enable=$(uci get softethervpn.@softether[0].enable)
|
||||
if [ $enable -eq 1 ]; then
|
||||
iptables -I INPUT -p udp -m multiport --dports 500,1701,4500 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT 2>/dev/null
|
||||
iptables -I INPUT -p udp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport $openvpnport -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 443 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 5555 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 8888 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
iptables -I INPUT -p tcp --dport 992 -m comment --comment "Rule For SoftEther VPN Server" -j ACCEPT
|
||||
fi
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"config": "softethervpn",
|
||||
"init": "softethervpn"
|
||||
}
|
||||
Reference in new issue
Block a user