summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Spangenberger2016-09-25 10:40:25 -0400
committerJesse Spangenberger2016-09-25 10:40:25 -0400
commit9cebe59838ed08a52932e7805b5ee98b9d9e2b27 (patch)
tree4aabe51dc6950a77da77d190d4d5ce70c79243ee
parent66fab79454e3530257b9c95f666d4b29a53a8e69 (diff)
downloadaur-9cebe59838ed08a52932e7805b5ee98b9d9e2b27.tar.gz
Updated to version 3.0
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD71
2 files changed, 40 insertions, 42 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 268792c5d4a2..4b7db21099c6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Sun Sep 25 12:50:36 UTC 2016
+# Sun Sep 25 14:34:57 UTC 2016
pkgbase = private-internet-access-vpn
pkgdesc = Installs VPN profiles for Private Internet Access Service
- pkgver = 2.9
- pkgrel = 3
+ pkgver = 3.0
+ pkgrel = 1
url = https://www.privateinternetaccess.com/
arch = any
license = GPL
@@ -15,17 +15,20 @@ pkgbase = private-internet-access-vpn
optdepends = connman: Enables PIA for Connman
optdepends = openvpn: Allows running configurations from command-line
noextract = openvpn.zip
+ noextract = openvpn-strong.zip
noextract = pia.8.gz
source = https://www.privateinternetaccess.com/openvpn/openvpn.zip
+ source = https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip
source = login-example.conf
source = pia-example.conf
source = restart.conf
source = vpn.sh
source = pia.8.gz
- source = git://github.com/flamusdiu/python-pia.git#tag=v2.9
+ source = git://github.com/flamusdiu/python-pia.git#tag=v3.0
source = git://github.com/masterkorp/openvpn-update-resolv-conf.git
source = update-resolv-conf.patch
sha256sums = 1f57eb735141b767f19d653ffa434ffa2d1108c2a5b74fe61c72542056360c77
+ sha256sums = 9d28e1883d5f2e1b017789c051c6377b1e97ed86f72f84f3ca33b15a909947c7
sha256sums = 4322a2a4bc3e206c6ab7e1df87a8805032b76c177c1ed9dd3501260ed32ccb30
sha256sums = 797dbdb6e3aadc86f97262e26d61cf4847caf85dda4b7a97cac59088cb912b27
sha256sums = 246fc4dc3218f56b4c70014df6801b10fc2a573d6545962b7fce05f16908c54e
diff --git a/PKGBUILD b/PKGBUILD
index e1f5507f7d80..f65815b59688 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,8 @@
# Maintainer: Jesse Spangenberger <azulephoenix@gmail.com>
+
pkgname=private-internet-access-vpn
-pkgver=2.9
-pkgrel=3
+pkgver=3.0
+pkgrel=1
pkgdesc="Installs VPN profiles for Private Internet Access Service"
arch=('any')
url="https://www.privateinternetaccess.com/"
@@ -12,6 +13,7 @@ optdepends=('networkmanager: Enables PIA for Network Manager'
'connman: Enables PIA for Connman'
'openvpn: Allows running configurations from command-line')
sha256sums=('1f57eb735141b767f19d653ffa434ffa2d1108c2a5b74fe61c72542056360c77'
+ '9d28e1883d5f2e1b017789c051c6377b1e97ed86f72f84f3ca33b15a909947c7'
'4322a2a4bc3e206c6ab7e1df87a8805032b76c177c1ed9dd3501260ed32ccb30'
'797dbdb6e3aadc86f97262e26d61cf4847caf85dda4b7a97cac59088cb912b27'
'246fc4dc3218f56b4c70014df6801b10fc2a573d6545962b7fce05f16908c54e'
@@ -22,50 +24,41 @@ sha256sums=('1f57eb735141b767f19d653ffa434ffa2d1108c2a5b74fe61c72542056360c77'
'b346249c40d4eab7cf5a2b682b10f574d5f8ad6cf2b62604f15261a246b5f5a1')
source=("https://www.privateinternetaccess.com/openvpn/openvpn.zip"
- "login-example.conf"
- "pia-example.conf"
- "restart.conf"
- "vpn.sh"
- "pia.8.gz"
- "git://github.com/flamusdiu/python-pia.git#tag=v${pkgver}"
- "git://github.com/masterkorp/openvpn-update-resolv-conf.git"
- "update-resolv-conf.patch")
+ "https://www.privateinternetaccess.com/openvpn/openvpn-strong.zip"
+ "login-example.conf"
+ "pia-example.conf"
+ "restart.conf"
+ "vpn.sh"
+ "pia.8.gz"
+ "git://github.com/flamusdiu/python-pia.git#tag=v${pkgver}"
+ "git://github.com/masterkorp/openvpn-update-resolv-conf.git"
+ "update-resolv-conf.patch")
noextract=("openvpn.zip"
- "pia.8.gz")
+ "openvpn-strong.zip"
+ "pia.8.gz")
prepare() {
cd "${srcdir}"
+
+ msg2 "Extracting Certifications..."
+ bsdtar -xf openvpn.zip "*.pem" "*.crt"
+ bsdtar -xf openvpn-strong.zip "*.pem" "*.crt"
+
+ msg2 "Extracting OpenVPN Configurations..."
mkdir "vpn-configs"
- bsdtar -xf openvpn.zip -C "vpn-configs"
-
+ bsdtar -xf openvpn.zip -C vpn-configs *.ovpn
+
cd "vpn-configs"
-
- msg2 "Fixing Openvpn Files..."
- for file in *.ovpn
+ msg2 "Creating Remote Host List..."
+ touch ../vpn-hosts.txt
+
+ find *.ovpn -print0 | while read -d $'\0' file
do
- msg2 " ${file/%.ovpn/ }..."
- # Switch .ovpn file extensions to .conf. This is what the openvpn systemd
- # service expects
- new_file_name="${file/%.ovpn/.conf}"
-
- # Swap spaces in filenames for underscores to be more command-line friendly
- new_file_name="${new_file_name// /_}"
- mv "$file" "$new_file_name"
-
- # Prevent caching of password in memory
- echo "auth-nocache" >> "$new_file_name"
-
- # Attempt to ensure that we use PIA DNS servers
- echo "script-security 2" >> "$new_file_name"
- echo "up /etc/openvpn/update-resolv-conf.sh" >> "$new_file_name"
- echo "down /etc/openvpn/update-resolv-conf.sh" >> "$new_file_name"
-
- # Fix certs in configs to use full path so when run from openvpn it works
- # i.e. sudo openvpn --config /etc/openvpn/US_East.conf
- sed -i -e 's:\(^ca.\):\1/etc/openvpn/:;s:\(^crl-verify.\):\1/etc/openvpn/:' "$new_file_name"
-
+ host=$(egrep -o "([-A-Za-z]+\.privateinternetaccess\.com)" "$file")
+ printf "%s,%s\n" "${file/%.ovpn/}" ${host} >> ../vpn-hosts.txt
done
+
msg2 "Done."
msg2 "Patching update-resolv-conf ..."
@@ -81,7 +74,9 @@ package() {
install -dm755 "${pkgdir}"/etc/{openvpn,private-internet-access}
- install -D -m 600 vpn-configs/*.* "${pkgdir}/etc/openvpn"
+ install -D -m 644 vpn-hosts.txt "${pkgdir}/etc/private-internet-access"
+ install -D -m 644 *.crt "${pkgdir}/etc/openvpn"
+ install -D -m 644 *.pem "${pkgdir}/etc/openvpn"
install -D -m 644 {pia-example.conf,login-example.conf} "${pkgdir}/etc/private-internet-access/"
install -D -m 755 openvpn-update-resolv-conf/update-resolv-conf.sh "${pkgdir}/etc/openvpn/update-resolv-conf.sh"