GlobalProtect-openconnect/packaging/files/usr/lib/NetworkManager/dispatcher.d/pre-up.d/gpclient.up
2025-01-19 22:20:12 +08:00

21 lines
411 B
Bash
Executable File

#!/bin/sh
# Resume the VPN connection if the network comes back up
set -e
PIDFILE=/tmp/gpservice_disconnected.pid
if [ -f $PIDFILE ]; then
PID=$(cat $PIDFILE)
# Always remove the PID file
rm $PIDFILE
# Ensure the PID is a gpservice process
if ps -p $PID -o comm= | grep -q gpservice; then
# Send a USR2 signal to the gpclient process to resume the VPN connection
kill -USR2 $PID
fi
fi