Skip to content

Instantly share code, notes, and snippets.

@ygorcrod
Forked from SydoxX/forti-fix.sh
Created July 22, 2023 17:57
Show Gist options
  • Save ygorcrod/7ef9fc9a52750276b0ba61a0cf92fce5 to your computer and use it in GitHub Desktop.
Save ygorcrod/7ef9fc9a52750276b0ba61a0cf92fce5 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