mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 02:55: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
+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
|
||||
}
|
||||
Reference in new issue
Block a user