mirror of
https://github.com/Ysurac/openmptcprouter-vps.git
synced 2025-02-15 04:42:12 +00:00
35 lines
678 B
Bash
Executable file
35 lines
678 B
Bash
Executable file
#!/bin/bash
|
|
# OpenMPTCProuter VPS service script
|
|
|
|
_multipath() {
|
|
# Force multipath status
|
|
source /etc/shorewall/params.net
|
|
for intf in `ls -1 /sys/class/net`; do
|
|
if [ "$intf" = "$NET_IFACE" ]; then
|
|
multipath $intf on
|
|
else
|
|
multipath $intf off
|
|
fi
|
|
done
|
|
}
|
|
|
|
_glorytun_udp() {
|
|
[ -z "$(glorytun show dev gt-udp-tun0 2>/dev/null | grep server)" ] && {
|
|
logger -t "OMR-Service" "Restart Glorytun-UDP"
|
|
systemctl -q restart glorytun-udp@*
|
|
}
|
|
}
|
|
|
|
_omr_api() {
|
|
[ -z "$(curl -s -k -m 1 https://127.0.0.1:65500/)" ] && {
|
|
logger -t "OMR-Service" "Restart OMR-Admin"
|
|
systemctl -q restart omr-admin
|
|
}
|
|
}
|
|
|
|
while true; do
|
|
_glorytun_udp
|
|
_multipath
|
|
_omr_api
|
|
sleep 10
|
|
done
|