mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-14 19:41:51 +00:00
Fix set IP for ss and VPN when set in openmptcprouter settings
This commit is contained in:
parent
149c30129d
commit
4db977432d
1 changed files with 42 additions and 0 deletions
|
@ -272,6 +272,46 @@ _get_vps_config() {
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
vpsip="$(uci -q get openmptcprouter.${servername}.ip)"
|
||||
if [ "$(uci -q get shadowsocks-libev.sss0.server)" != "127.0.0.1" ] && [ "$(uci -q get shadowsocks-libev.sss0.server)" != "$vpsip" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set shadowsocks-libev.sss0.server="$vpsip"
|
||||
commit shadowsocks-libev
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart shadowsocks..."
|
||||
/etc/init.d/shadowsocks-libev restart
|
||||
fi
|
||||
if [ "$(uci -q get openvpn.omr.remote)" != "127.0.0.1" ] && [ "$(uci -q get openvpn.omr.remote)" != "$vpsip" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set openvpn.omr.remote="$vpsip"
|
||||
commit openvpn
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart OpenVPN..."
|
||||
/etc/init.d/openvpn restart
|
||||
fi
|
||||
if [ "$(uci -q get dsvpn.vpn.host)" != "127.0.0.1" ] && [ "$(uci -q get dsvpn.vpn.host)" != "$vpsip" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set dsvpn.vpn.host="$vpsip"
|
||||
commit dsvpn
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart DSVPN..."
|
||||
/etc/init.d/dsvpn restart
|
||||
fi
|
||||
if [ "$(uci -q get mlvpn.general.host)" != "127.0.0.1" ] && [ "$(uci -q get mlvpn.general.host)" != "$vpsip" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set mlvpn.general.host="$vpsip"
|
||||
commit mlvpn
|
||||
EOF
|
||||
logger -t "OMR-VPS" "Restart MLVPN..."
|
||||
/etc/init.d/mlvpn restart
|
||||
fi
|
||||
if [ "$(uci -q get glorytun.vpn.host)" != "127.0.0.1" ] && [ "$(uci -q get glorytun.vpn.host)" != "$vpsip" ]; then
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
set glorytun.vpn.host="$vpsip"
|
||||
EOF
|
||||
glorytun_change=1
|
||||
fi
|
||||
|
||||
if [ "$glorytun_change" != "0" ]; then
|
||||
logger -t "OMR-VPS" "Restart glorytun..."
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
|
@ -463,6 +503,8 @@ _set_config_from_vps() {
|
|||
[ -z "$vps_config" ] && vps_config=$(_get_json "config")
|
||||
[ -z "$vps_config" ] && return
|
||||
|
||||
logger -t "OMR-VPS" "Get config from VPS..."
|
||||
|
||||
# get VPS ip
|
||||
vpsip="$(uci -q get openmptcprouter.${servername}.ip)"
|
||||
vps_lastchange="$(echo "$vps_config" | jsonfilter -q -e '@.vps.lastchange')"
|
||||
|
|
Loading…
Reference in a new issue