diff --git a/debian9-x86_64.sh b/debian9-x86_64.sh index f970370..27938fc 100755 --- a/debian9-x86_64.sh +++ b/debian9-x86_64.sh @@ -141,6 +141,11 @@ if [ "$UPDATE" = "yes" ]; then fi echo "Update mode" fi +# Force update key +[ -f /etc/apt/sources.list.d/openmptcprouter.list ] && { + echo "Update OpenMPTCProuter repo key" + wget -O - http://repo.openmptcprouter.com/openmptcprouter.gpg.key | apt-key add - +} CURRENT_OMR="$(grep -s 'OpenMPTCProuter VPS' /etc/* | awk '{print $4}')" if [ "$REINSTALL" = "no" ] && [ "$CURRENT_OMR" = "$OMR_VERSION" ]; then @@ -679,18 +684,12 @@ if [ "$V2RAY" = "yes" ]; then else apt-get -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-overwrite" -y install v2ray=${V2RAY_VERSION} fi - if [ -f /etc/v2ray/v2ray-server.conf ] && [ ! -f /etc/systemd/system/v2ray.service ]; then - wget -O /etc/systemd/system/v2ray.service ${VPSURL}${VPSPATH}/old-v2ray.service - fi if [ ! -f /etc/v2ray/v2ray-server.json ]; then wget -O /etc/v2ray/v2ray-server.json ${VPSURL}${VPSPATH}/v2ray-server.json sed -i "s:V2RAY_UUID:$V2RAY_UUID:g" /etc/v2ray/v2ray-server.json rm /etc/v2ray/config.json ln -s /etc/v2ray/v2ray-server.json /etc/v2ray/config.json fi - ln -sf /etc/v2ray/v2ray-server.json /etc/v2ray/config.json - sed -i 's:debug:warning:' /etc/v2ray/v2ray-server.json - rm -f /tmp/v2rayError.log if [ -f /etc/systemd/system/v2ray.service.dpkg-dist ]; then mv -f /etc/systemd/system/v2ray.service.dpkg-dist /etc/systemd/system/v2ray.service fi diff --git a/omr-service b/omr-service index e1eaa5e..f388c5d 100755 --- a/omr-service +++ b/omr-service @@ -79,19 +79,21 @@ _lan_route() { _gre_tunnels() { . "$(readlink -f "/etc/shorewall/params.vpn")" - for intf in /etc/openmptcprouter-vps-admin/intf/*; do - if [ -f "$intf" ]; then - . "$(readlink -f "$intf")" - iface="$(basename $intf)" - if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then - ip tunnel del $iface 2>&1 >/dev/null - ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR 2>&1 >/dev/null - ip link set $iface up 2>&1 >/dev/null - ip addr add $LOCALIP dev $iface 2>&1 >/dev/null - ip route add $NETWORK dev $iface 2>&1 >/dev/null + if [ -n "$OMR_ADDR" ]; then + for intf in /etc/openmptcprouter-vps-admin/intf/*; do + if [ -f "$intf" ]; then + . "$(readlink -f "$intf")" + iface="$(basename $intf)" + if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then + ip tunnel del $iface 2>&1 >/dev/null + ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR 2>&1 >/dev/null + ip link set $iface up 2>&1 >/dev/null + ip addr add $LOCALIP dev $iface 2>&1 >/dev/null + ip route add $NETWORK dev $iface 2>&1 >/dev/null + fi fi - fi - done + done + fi } _openvpn_bonding() {