forked from snwh/ubuntu-post-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpia
executable file
·41 lines (40 loc) · 1.32 KB
/
pia
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Private Internet Access
function install_pia {
# Variables
NAME="Private Internet Access"
TARBALL=pia-v75-installer-linux
VERSION=v75
CHECKSUM=4948b4a7f8d6454ac3bada85e37883a3b775a45f7da8e83a2c17042053c62b4b
# Start
echo_message header 'Begin '$NAME' installation'
# Download
echo_message info 'Downloading tarball for version '$VERSION'...'
curl -O https://installers.privateinternetaccess.com/download/${TARBALL}.tar.gz
# Verify download via sha256sum
echo_message info 'Verifying download using SHA-256...'
sha256sum ${TARBALL}.tar.gz | grep $CHECKSUM &> /dev/null
EXITSTATUS=$?
if [ $EXITSTATUS = 1 ]; then
# If checksum fails
echo_message error 'Error: checksums do not match. Aborting...'
whiptail --title "Error" --msgbox "Verification of $NAME download failed." 8 56
rm ${TARBALL}*.tar.gz
thirdparty
else
# If checksum succeeds
echo_message success "Checksums look good. Proceeding"
# Unpack tarball
echo_message info 'Unpacking '$NAME' archive...'
tar -xzf $TARBALL*.tar.gz
# Run install script
echo_message info 'Running install script...'
./${TARBALL}.sh
# Cleanup and finish
rm ${TARBALL}*.tar.gz
rm ${TARBALL}*.sh
echo_message success "Installation of '$TARBALL' complete."
whiptail --title "Finished" --msgbox "Installation of $NAME complete." 8 56
thirdparty
fi
}