diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index 06a0354d9..4d818b98e 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -229,7 +229,7 @@ _set_config_from_vps() { [ -z "$shadowsocks_disabled" ] && shadowsocks_disabled=0 ss_key="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks.key')" ss_key="$(echo $ss_key | sed 's/-/+/g; s/_/\//g;')" - if [ "$ss_key" != "$(uci -q get shadowsocks-libev.sss0.key)" ]; then + if [ -n "$ss_key" ] && [ "$ss_key" != "$(uci -q get shadowsocks-libev.sss0.key)" ]; then ss_method="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks.method')" ss_port="$(echo "$vps_config" | jsonfilter -q -e '@.shadowsocks.port')" [ -z "$ss_port" ] && ss_port=65101 @@ -248,7 +248,7 @@ _set_config_from_vps() { # Glorytun settings glorytun_key="$(echo "$vps_config" | jsonfilter -q -e '@.glorytun.key')" - if [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]; then + if [ -n "$glorytun_key" ] && [ "$glorytun_key" != "$(uci -q get glorytun.vpn.key)" ]; then vpn="$(uci -q get openmptcprouter.settings.vpn)" glorytun_state=0 if [ "$vpn" = "glorytun_tcp" ]; then @@ -284,7 +284,7 @@ _set_config_from_vps() { # MLVPN settings mlvpn_key="$(echo "$vps_config" | jsonfilter -q -e '@.mlvpn.key')" - if [ "$mlvpn_key" != "$(uci -q get mlvpn.general.password)" ]; then + if [ -n "$mlvpn_key" ] && [ "$mlvpn_key" != "$(uci -q get mlvpn.general.password)" ]; then uci -q batch <<-EOF >/dev/null set mlvpn.general.password=$mlvpn_key commit mlvpn