Skip to content

Instantly share code, notes, and snippets.

@jcottrell
Created June 20, 2016 19:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcottrell/f8d65717f48a8dab4c15bd23387a375f to your computer and use it in GitHub Desktop.
Save jcottrell/f8d65717f48a8dab4c15bd23387a375f to your computer and use it in GitHub Desktop.
Run FortiClient on MacOSX and then run El Capitan repair script
#!/bin/bash
sudo echo "Starting FortiClient ..."
/Applications/FortiClient.app/Contents/MacOS/FortiClient > /dev/null 2>&1 &
secs=30
while [ $secs -gt 0 ]; do
echo -ne "Waiting for you to log into FortiClient: $secs\033[0K\r"
sleep 1
: $((secs--))
done
echo ""
echo "Running FortiClient repair for MacOSX El Capitan ..."
# http://serverfault.com/questions/728702/how-to-get-forticlient-working-in-osx-el-capitan
# run this after connected with forticlient
default_line=$(netstat -rn |grep default)
gateway=$(echo $default_line | awk '{print $2}')
interface=$(echo $default_line | awk '{print $6}')
echo $gateway
echo $interface
sudo scutil <<EOF
d.init
get State:/Network/Service/forticlientsslvpn/IPv4
d.add InterfaceName ppp0
set State:/Network/Service/forticlientsslvpn/IPv4
EOF
sudo route delete default
sudo route delete -ifscope $interface default
sudo route add -ifscope $interface default $gateway
sudo route add -net 0.0.0.0 -interface $interface
echo "... Finished repair script"
@jcottrell
Copy link
Author

Just make this executable chmod +x forticlient-helper.sh and then run this script instead of the gui version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment