Skip to content

Instantly share code, notes, and snippets.

@fdoliv
Forked from SydoxX/forti-fix.sh
Created June 16, 2023 00:14
Show Gist options
  • Save fdoliv/0748a2c4b0fa34ca7a3e18e5d68b8d5f to your computer and use it in GitHub Desktop.
Save fdoliv/0748a2c4b0fa34ca7a3e18e5d68b8d5f to your computer and use it in GitHub Desktop.
Fixes Forticlient 7.0.7
#!/bin/bash
echo "Try to connect to the VPN now"
x=99
while [ $x -ne 0 ]
do
echo "Waiting for VPN connection..."
sleep 1
connection=$(nmcli connection show | grep -oP '^vpn\S*')
x=$?
done
echo "VPN connection $connection was created! Waiting for 'device-reapply'..."
x=99
while [ $x -ne 0 ]
do
nmcli -f GENERAL.STATE con show $connection 2> /dev/null
x=${PIPESTATUS[0]}
sleep 1
echo "Still waiting..."
done
echo "Device is unmanaged. Setting it to 'up' again..."
nmcli con up $connection 2> /dev/null
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment