Posted on 03-11-2019 01:25 PM
So I use to have a script that downloaded PIA VPN but now when I run a curl command on terminal using
' curl https://www.privateinternetaccess.com/installer/x/download_installer_osx '
it just shows the website in plain text rather than an app can anyone offer any insights what is the best way to go about this?
Posted on 03-13-2019 01:08 AM
Hello Euwan
The file address is https://installers.privateinternetaccess.com/download/pia-macos-1.1.1-02545.zip
You could try
curl --silent "https://installers.privateinternetaccess.com/download/pia-macos-1.1.1-02545.zip" -o /tmp/pia-macos.zip
Is this part of any automated process?
Posted on 03-13-2019 02:47 AM
Yea it is automated got it sorted now. Used this script
mkdir -p /Volumes/Macintosh HD/Users/Shared/temp
cd /Volumes/Macintosh HD/Users/Shared/temp
curl -LO https://www.privateinternetaccess.com/installer/x/download_installer_osx
PIAURL=$(cat download_installer_osx | grep .zip | grep -Eo "(http|https)://[a-zA-Z0-9./?=-]")
PIAZIP=$(ls | grep *.zip)
curl -LO $PIAURL
unzip $PIAZIP
sleep 30
open /Volumes/Macintosh HD/Users/Shared/temp/Private Internet Access Installer.app
sleep 100
rm -rf /Volumes/Macintosh HD/Users/Shared/temp
exit
Posted on 10-17-2022 03:41 AM
Three years later I find this solution. But somehow your GREP only returns 'https://i' Maybe something went wrong with the copy/paste in here?
GREP is not my specialty, so I am having a hard time trying to get it to work. If anyone has any tips?
Posted on 03-14-2019 08:57 AM
@Euwanh Thanks for the script. I have something similar I want to achieve but I want the site i'm going to to m.meraki.com requires that I input a value. I've used the POST command to add value but may be doing it wrong. Any suggestions?
Posted on 09-02-2019 01:17 AM
@tomatoes27 sorry for the very long delay did you need further assistance with this? I know how daunting it can be when you first start using jamf and then have to write scripts
06-28-2023 02:11 AM - edited 06-28-2023 02:12 AM
Managed to get the script working at least. But then the installer gives a prompt to install a helper app and requiring a password. Guess that there is no way around this.....
#!/bin/bash
#Go to downloadsfolder
cd ~/Downloads
#download PIA text file with updated .zip name
curl -LO https://www.privateinternetaccess.com/installer/x/download_installer_osx
#isolate the zip URL name
PIAURL=$(cat download_installer_osx | grep .zip | grep -Eo "https://.+\.zip")
sleep 10
#Download zip file
curl -LO $PIAURL
sleep 10
#isolate the zip file name
PIAZIP=$(ls | grep pia*.zip)
#Unzip files
unzip $PIAZIP
sleep 10
#Run PIA Installer
open ~/Downloads/Private\ Internet\ Access\ Installer.app
sleep 100
exit