Created
June 20, 2016 19:01
-
-
Save jcottrell/f8d65717f48a8dab4c15bd23387a375f to your computer and use it in GitHub Desktop.
Run FortiClient on MacOSX and then run El Capitan repair script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just make this executable
chmod +x forticlient-helper.sh
and then run this script instead of the gui version.