Created
November 23, 2016 13:20
-
-
Save shahinism/2c90d63a466f3d23b9da77dc97956619 to your computer and use it in GitHub Desktop.
Install openconnect client on macos
This file contains 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 | |
find_or_install() { | |
# Check if brew package $1 is installed | |
# http://stackoverflow.com/a/20802425/1573477 | |
if brew ls --versions $1 > /dev/null; then | |
echo "Installing ${1}" | |
brew install $1 | |
else | |
echo "${1} is already installed." | |
fi | |
} | |
if [ "$(uname -s)" != "Darwin" ]; then | |
echo "This script is for OSX" | |
echo "Exiting..." | |
exit 1 | |
fi | |
# Check if xcode commandline tools are installed. | |
# http://apple.stackexchange.com/a/219508 | |
if type xcode-select >&- && xpath=$( xcode-select --print-path ) && | |
test -d "${xpath}" && test -x "${xpath}" ; then | |
xcode-select --install | |
else | |
echo "Xcode command line tools are available." | |
fi | |
# Install or update brew | |
which -s brew | |
if [[ $? != 0 ]] ; then | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
else | |
echo "Homebrew is available. Updating..." | |
brew update | |
fi | |
find_or_install openconnect | |
find_or_install caskroom/cask/brew-cask | |
find_or_install tuntap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment