1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-02-12 19:31:54 +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 fi
echo "Update mode" echo "Update mode"
fi 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..." echo "Remove lock and update packages list..."
rm -f /var/lib/dpkg/lock rm -f /var/lib/dpkg/lock
@ -211,7 +216,7 @@ fi
rm -f /etc/grub.d/30_os-prober rm -f /etc/grub.d/30_os-prober
bash update-grub.sh ${KERNEL_VERSION}-mptcp bash update-grub.sh ${KERNEL_VERSION}-mptcp
bash update-grub.sh ${KERNEL_RELEASE} 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" echo "Install tracebox OpenMPTCProuter edition"
apt-get -y -o Dpkg::Options::="--force-overwrite" install tracebox apt-get -y -o Dpkg::Options::="--force-overwrite" install tracebox
@ -1157,7 +1162,7 @@ if [ "$update" = "0" ]; then
echo 'Your glorytun key: ' echo 'Your glorytun key: '
echo $GLORYTUN_PASS echo $GLORYTUN_PASS
if [ "$DSVPN" = "yes" ]; then 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 'A Dead Simple VPN key: '
echo $DSVPN_PASS echo $DSVPN_PASS
fi fi
@ -1204,7 +1209,7 @@ if [ "$update" = "0" ]; then
EOF EOF
if [ "$DSVPN" = "yes" ]; then if [ "$DSVPN" = "yes" ]; then
cat >> /root/openmptcprouter_config.txt <<-EOF 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} A Dead Simple VPN key: ${DSVPN_PASS}
EOF EOF
fi fi
@ -1227,6 +1232,7 @@ if [ "$update" = "0" ]; then
Your OpenMPTCProuter Server username: openmptcprouter Your OpenMPTCProuter Server username: openmptcprouter
EOF EOF
fi fi
systemctl -q restart sshd
else else
echo '====================================================================================' echo '===================================================================================='
echo "OpenMPTCProuter Server is now updated to version $OMR_VERSION !" echo "OpenMPTCProuter Server is now updated to version $OMR_VERSION !"

View file

@ -60,19 +60,21 @@ _lan_route() {
_gre_tunnels() { _gre_tunnels() {
. "$(readlink -f "/etc/shorewall/params.vpn")" . "$(readlink -f "/etc/shorewall/params.vpn")"
for intf in /etc/openmptcprouter-vps-admin/intf/*; do if [ -n "$OMR_ADDR" ]; then
if [ -f "$intf" ]; then for intf in /etc/openmptcprouter-vps-admin/intf/*; do
. "$(readlink -f "$intf")" if [ -f "$intf" ]; then
iface="$(basename $intf)" . "$(readlink -f "$intf")"
if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then iface="$(basename $intf)"
ip tunnel del $iface 2>&1 >/dev/null if [ "$(ip tunnel show $iface 2>/dev/null | awk '{print $4}')" != "$OMR_ADDR" ]; then
ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR ip tunnel del $iface 2>&1 >/dev/null
ip link set $iface up ip tunnel add $iface mode gre local $INTFADDR remote $OMR_ADDR 2>&1 >/dev/null
ip addr add $LOCALIP dev $iface ip link set $iface up 2>&1 >/dev/null
ip route add $NETWORK dev $iface 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
fi done
done fi
} }
_openvpn_bonding() { _openvpn_bonding() {