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

Fix on current-vpn file doesn't exist

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-11-03 16:45:29 +00:00
parent f4beb2f5a5
commit 68211f2033
2 changed files with 2 additions and 1 deletions

View file

@ -389,6 +389,7 @@ if [ "$OMR_ADMIN" = "yes" ]; then
pip3 -q install fastapi netjsonconfig python-multipart -U
mkdir -p /etc/openmptcprouter-vps-admin/omr-6in4
mkdir -p /etc/openmptcprouter-vps-admin/intf
[ ! -f "/etc/openmptcprouter-vps-admin/current-vpn" ] && echo "glorytun_tcp" > /etc/openmptcprouter-vps-admin/current-vpn
mkdir -p /var/opt/openmptcprouter
if [ "$SOURCES" = "yes" ]; then
wget -O /lib/systemd/system/omr-admin.service ${VPSURL}${VPSPATH}/omr-admin.service.in

View file

@ -27,7 +27,7 @@ _glorytun_tcp() {
for intf in /etc/glorytun-tcp/tun*; do
[ "$(echo $intf | grep key)" = "" ] && /etc/glorytun-tcp/post.sh ${intf}
done
if [ "$(cat /etc/openmptcprouter-vps-admin/current-vpn)" = "glorytun_tcp" ]; then
if [ -f /etc/openmptcprouter-vps-admin/current-vpn ] && [ "$(cat /etc/openmptcprouter-vps-admin/current-vpn)" = "glorytun_tcp" ]; then
if [ "$(ping -c 5 -w 5 10.255.255.2 | grep '100%')" != "" ]; then
logger -t "OMR-Service" "No answer from VPN client end, restart Glorytun-TCP"
systemctl restart glorytun-tcp@tun0