mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Small changes and more logs
This commit is contained in:
parent
315a4c718f
commit
4c1d68cf9c
2 changed files with 14 additions and 4 deletions
|
@ -242,8 +242,8 @@ if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "om
|
|||
_log "Tunnel up disable use of ShadowSocks for UDP"
|
||||
uci -q delete shadowsocks-libev.ss_rules.redir_udp
|
||||
if /etc/init.d/shadowsocks-libev rules_exist ; then
|
||||
/etc/init.d/shadowsocks-libev rules_down
|
||||
/etc/init.d/shadowsocks-libev rules_up
|
||||
/etc/init.d/shadowsocks-libev rules_down >/dev/null 2>&1
|
||||
/etc/init.d/shadowsocks-libev rules_up >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -465,7 +465,7 @@ fi
|
|||
}
|
||||
|
||||
# If a service is down, force restart it
|
||||
if [ "$(pgrep ss-redir)" = "" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" = "0" ]; then
|
||||
if [ "$(pgrep ss-redir)" = "" ] && [ "$(pgrep ss-local)" = "" ] && [ "$(uci -q get shadowsocks-libev.sss0.disabled)" = "0" ]; then
|
||||
_log "Can't find Shadowsocks, restart it..."
|
||||
/etc/init.d/shadowsocks-libev restart
|
||||
sleep 5
|
||||
|
|
|
@ -212,6 +212,7 @@ _get_vps_config() {
|
|||
set dhcp.@dnsmasq[0].rebind_protection='0'
|
||||
commit dhcp
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart dnsmasq..."
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
@ -257,6 +258,7 @@ _get_vps_config() {
|
|||
set dhcp.@dnsmasq[0].rebind_protection='0'
|
||||
commit dhcp
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart dnsmasq..."
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
@ -269,6 +271,7 @@ _get_vps_config() {
|
|||
set dhcp.@dnsmasq[0].rebind_protection='0'
|
||||
commit dhcp
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart dnsmasq..."
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
|
@ -281,10 +284,12 @@ _get_vps_config() {
|
|||
set dhcp.@dnsmasq[0].rebind_protection='0'
|
||||
commit dhcp
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart dnsmasq..."
|
||||
/etc/init.d/dnsmasq restart >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
if [ "$glorytun_change" != "0" ]; then
|
||||
logger -t "OMR-VPS" "Restart glorytun..."
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
commit glorytun
|
||||
EOF
|
||||
|
@ -394,6 +399,7 @@ _set_config_from_vps() {
|
|||
set shadowsocks-libev.sss0.disabled=$shadowsocks_disabled
|
||||
commit shadowsocks-libev
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Shadowsocks restart..."
|
||||
/etc/init.d/shadowsocks-libev restart >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
@ -420,6 +426,7 @@ _set_config_from_vps() {
|
|||
set glorytun.vpn.chacha20=$glorytun_chacha
|
||||
commit glorytun
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Glorytun restart..."
|
||||
/etc/init.d/glorytun restart >/dev/null 2>&1
|
||||
/etc/init.d/glorytun-udp restart >/dev/null 2>&1
|
||||
fi
|
||||
|
@ -435,6 +442,8 @@ _set_config_from_vps() {
|
|||
set openvpn.omr.secret="/etc/luci-uploads/openvpn.key"
|
||||
commit openvpn
|
||||
EOF
|
||||
logger -t "OMR-VPS" "OpenVPN restart..."
|
||||
/etc/init.d/mlvpn restart
|
||||
}
|
||||
|
||||
# MLVPN settings
|
||||
|
@ -444,6 +453,7 @@ _set_config_from_vps() {
|
|||
set mlvpn.general.password=$mlvpn_key
|
||||
commit mlvpn
|
||||
EOF
|
||||
logger -t "OMR-VPS" "MLVPN restart..."
|
||||
/etc/init.d/mlvpn restart
|
||||
fi
|
||||
|
||||
|
@ -551,6 +561,7 @@ _config_service() {
|
|||
[ "$(uci -q get openmptcprouter.${servername}.get_config)" = "1" ] && {
|
||||
_set_config_from_vps
|
||||
}
|
||||
_get_vps_config
|
||||
if [ "$(uci -q get openmptcprouter.settings.firstboot)" != "0" ] && [ -n "$(cat /proc/cpuinfo | grep aes)" ]; then
|
||||
logger -t "OMR-VPS" "CPU support AES, set it by default"
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
|
@ -562,7 +573,6 @@ _config_service() {
|
|||
fi
|
||||
uci -q set openmptcprouter.settings.firstboot=0
|
||||
|
||||
_get_vps_config
|
||||
config_load shadowsocks-libev
|
||||
config_foreach _set_ss_server_vps server
|
||||
_set_glorytun_vps
|
||||
|
|
Loading…
Reference in a new issue