Skip to content

Instantly share code, notes, and snippets.

@stvhwrd
Last active January 28, 2018 21:37
Show Gist options
  • Save stvhwrd/4155fee9c4fd78756aceda17debac5bb to your computer and use it in GitHub Desktop.
Save stvhwrd/4155fee9c4fd78756aceda17debac5bb to your computer and use it in GitHub Desktop.
[WIP] Install and/or update Private Internet Access' available OpenVPN config with Tunnelblick on macOS
#!/bin/env bash
echo "This script is a work in progress." @DEBUG
# Assumes that wget is installed.
echo "Install configurations for all Users?"
# Move config files to (i) user directory or (ii) all-users directory, based on user's input
# Download and unzip config files
wget https://www.privateinternetaccess.com/openvpn/openvpn.zip -P /tmp
# Maybe calculate hash of zip file so that in future we can stop here if user attempts
# to upgrade and there is no newer version
unzip /tmp/openvpn.zip -d /tmp/openvpn-config
# Change permissions
# Move config files
# if username not stored already:
echo "Enter PIA username:"
# Store username securely, maybe osxkeychain
# if passphrase not stored already:
echo "Enter PIA passphrase:"
# Store passphrase securely, maybe osxkeychain
echo "Testing connection with _________"
# Connect to some random server, maybe based on ping
# After connection, verify that network adapter can still send/receive
# if argv[1] == "install" || arv[1] == "reinstall"
echo "Installation successful"
# else if argv[1] == "upgrade" || arv[1] == "update"
echo "PIA OpenVPN update complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment