1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-02-12 11:21:56 +00:00

Update server script

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-06-14 05:47:42 +00:00
parent e6d3bb7279
commit a5cf11a449
2 changed files with 23 additions and 15 deletions

View file

@ -123,6 +123,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 -
}
echo "Remove lock and update packages list..."
rm -f /var/lib/dpkg/lock
@ -211,7 +216,7 @@ fi
rm -f /etc/grub.d/30_os-prober
bash update-grub.sh ${KERNEL_VERSION}-mptcp
bash update-grub.sh ${KERNEL_RELEASE}
sed -i 's/default="1>0"/default="0"/' /boot/grub/grub.cfg 2>&1 >/dev/null
[ -f /boot/grub/grub.cfg ] && sed -i 's/default="1>0"/default="0"/' /boot/grub/grub.cfg 2>&1 >/dev/null
echo "Install tracebox OpenMPTCProuter edition"
apt-get -y -o Dpkg::Options::="--force-overwrite" install tracebox
@ -1157,7 +1162,7 @@ if [ "$update" = "0" ]; then
echo 'Your glorytun key: '
echo $GLORYTUN_PASS
if [ "$DSVPN" = "yes" ]; then
echo 'A Dead Simple VPN port: 65011'
echo 'A Dead Simple VPN port: 65401'
echo 'A Dead Simple VPN key: '
echo $DSVPN_PASS
fi
@ -1204,7 +1209,7 @@ if [ "$update" = "0" ]; then
EOF
if [ "$DSVPN" = "yes" ]; then
cat >> /root/openmptcprouter_config.txt <<-EOF
A Dead Simple VPN port: 65011
A Dead Simple VPN port: 65401
A Dead Simple VPN key: ${DSVPN_PASS}
EOF
fi
@ -1227,6 +1232,7 @@ if [ "$update" = "0" ]; then
Your OpenMPTCProuter Server username: openmptcprouter
EOF
fi
systemctl -q restart sshd
else
echo '===================================================================================='
echo "OpenMPTCProuter Server is now updated to version $OMR_VERSION !"

View file

@ -60,19 +60,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
ip link set $iface up
ip addr add $LOCALIP dev $iface
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() {