diff options
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | login-example.conf | 3 | ||||
-rw-r--r-- | openvpn.zip | bin | 0 -> 10802 bytes | |||
-rw-r--r-- | restart.conf | 2 | ||||
-rw-r--r-- | source.tar.gz | bin | 490 -> 0 bytes | |||
-rw-r--r-- | update-resolv-conf.sh | 61 | ||||
-rwxr-xr-x | vpn.sh | 5 |
8 files changed, 92 insertions, 10 deletions
@@ -13,12 +13,16 @@ pkgbase = private-internet-access-vpn noextract = pia.8.gz source = https://www.privateinternetaccess.com/openvpn/openvpn.zip source = https://raw.githubusercontent.com/masterkorp/openvpn-update-resolv-conf/master/update-resolv-conf.sh - source = source.tar.gz + source = login-example.conf + source = restart.conf + source = vpn.sh source = pia.8.gz - source = git+https://github.com/flamusdiu/python-pia.git#tag=v2.0 + source = git+https://github.com/flamusdiu/python-pia.git#tag=v2.0.1 sha256sums = c2f9af251ae63395896366e0be03ff4eea7748dcc6333fbe777a8f09317bba92 sha256sums = 6d3bdc9531f16cc1ad199913a71554a0b50aea87e140b28d079c4ab4c0b8c51b - sha256sums = 604fec9bb019a79c582cf581bac960109cea87bf0a5d7dc242fe8210efbe9cd5 + sha256sums = 4322a2a4bc3e206c6ab7e1df87a8805032b76c177c1ed9dd3501260ed32ccb30 + sha256sums = 246fc4dc3218f56b4c70014df6801b10fc2a573d6545962b7fce05f16908c54e + sha256sums = 7f4a5ee1fb8ea4d0e69ed2a8217c575cf335f21e90082f6e423c769eca4a7a46 sha256sums = f74e0a601d74409c39d36f4d5c6a2f11c9832d05782f804243b3f6ae7e695aab sha256sums = SKIP @@ -12,15 +12,19 @@ optdepends=('networkmanager: Enables PIA for Network Manager' 'openvpn: Allows running configurations from command-line') sha256sums=('c2f9af251ae63395896366e0be03ff4eea7748dcc6333fbe777a8f09317bba92' '6d3bdc9531f16cc1ad199913a71554a0b50aea87e140b28d079c4ab4c0b8c51b' - '604fec9bb019a79c582cf581bac960109cea87bf0a5d7dc242fe8210efbe9cd5' + '4322a2a4bc3e206c6ab7e1df87a8805032b76c177c1ed9dd3501260ed32ccb30' + '246fc4dc3218f56b4c70014df6801b10fc2a573d6545962b7fce05f16908c54e' + '7f4a5ee1fb8ea4d0e69ed2a8217c575cf335f21e90082f6e423c769eca4a7a46' 'f74e0a601d74409c39d36f4d5c6a2f11c9832d05782f804243b3f6ae7e695aab' 'SKIP') source=("https://www.privateinternetaccess.com/openvpn/openvpn.zip" "https://raw.githubusercontent.com/masterkorp/openvpn-update-resolv-conf/master/update-resolv-conf.sh" - "source.tar.gz" + "login-example.conf" + "restart.conf" + "vpn.sh" "pia.8.gz" - "git+https://github.com/flamusdiu/python-pia.git#tag=v2.0") + "git+https://github.com/flamusdiu/python-pia.git#tag=v2.0.1") noextract=("openvpn.zip" "pia.8.gz") @@ -65,14 +69,17 @@ prepare() { package() { cd "${srcdir}" - cp -R {etc/,usr/} "${pkgdir}" - - install -dm 600 "${pkgdir}/etc/openvpn/" - install -dm 755 "${pkgdir}/usr/bin/" + install -dm 755 "${pkgdir}/usr/lib/system/systemd/system-sleep" + install -dm 755 "${pkgdir}/usr/lib/system/openvpn@.service.d" + install -dm 600 "${pkgdir}/etc/openvpn" + install -dm 755 "${pkgdir}/etc/private-internet-access" + install -dm 755 "${pkgdir}/usr/bin" install -dm 755 "${pkgdir}/usr/share/man/man8" install -Dm 600 vpn-configs/*.* "${pkgdir}/etc/openvpn/" install -m 755 update-resolv-conf.sh "${pkgdir}/etc/openvpn" + install -m 644 restart.conf "${pkgdir}/usr/lib/system/openvpn@.service.d" + install -m 755 vpn.sh "${pkgdir}/usr/lib/system/systemd/system-sleep" install -m 644 pia.8.gz "${pkgdir}/usr/share/man/man8" cd "python-pia" diff --git a/login-example.conf b/login-example.conf new file mode 100644 index 000000000000..c75c6e9cc2a2 --- /dev/null +++ b/login-example.conf @@ -0,0 +1,3 @@ +your-username +your-password + diff --git a/openvpn.zip b/openvpn.zip Binary files differnew file mode 100644 index 000000000000..a564059a0aab --- /dev/null +++ b/openvpn.zip diff --git a/restart.conf b/restart.conf new file mode 100644 index 000000000000..8a764e347883 --- /dev/null +++ b/restart.conf @@ -0,0 +1,2 @@ +[Service] +Restart=always diff --git a/source.tar.gz b/source.tar.gz Binary files differdeleted file mode 100644 index bdc2691431b2..000000000000 --- a/source.tar.gz +++ /dev/null diff --git a/update-resolv-conf.sh b/update-resolv-conf.sh new file mode 100644 index 000000000000..1f306d42bef4 --- /dev/null +++ b/update-resolv-conf.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# +# Parses DHCP options from openvpn to update resolv.conf +# To use set as 'up' and 'down' script in your openvpn *.conf: +# up /etc/openvpn/update-resolv-conf +# down /etc/openvpn/update-resolv-conf +# +# Used snippets of resolvconf script by Thomas Hood <jdthood@yahoo.co.uk> +# and Chris Hanson +# Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. +# 07/2013 colin@daedrum.net Fixed intet name +# 05/2006 chlauber@bnc.ch +# +# Example envs set from openvpn: +# foreign_option_1='dhcp-option DNS 193.43.27.132' +# foreign_option_2='dhcp-option DNS 193.43.27.133' +# foreign_option_3='dhcp-option DOMAIN be.bnc.ch' +# foreign_option_4='dhcp-option DOMAIN-SEARCH bnc.local' + +## You might need to set the path manually here, i.e. +RESOLVCONF=/usr/bin/resolvconf + +case $script_type in + +up) + for optionname in ${!foreign_option_*} ; do + option="${!optionname}" + echo $option + part1=$(echo "$option" | cut -d " " -f 1) + if [ "$part1" == "dhcp-option" ] ; then + part2=$(echo "$option" | cut -d " " -f 2) + part3=$(echo "$option" | cut -d " " -f 3) + if [ "$part2" == "DNS" ] ; then + IF_DNS_NAMESERVERS="$IF_DNS_NAMESERVERS $part3" + fi + if [[ "$part2" == "DOMAIN" || "$part2" == "DOMAIN-SEARCH" ]] ; then + IF_DNS_SEARCH="$IF_DNS_SEARCH $part3" + fi + fi + done + R="" + if [ "$IF_DNS_SEARCH" ]; then + R="search " + for DS in $IF_DNS_SEARCH ; do + R="${R} $DS" + done + R="${R} +" + fi + + for NS in $IF_DNS_NAMESERVERS ; do + R="${R}nameserver $NS +" + done + #echo -n "$R" | $RESOLVCONF -p -a "${dev}" + echo -n "$R" | $RESOLVCONF -a "${dev}.inet" + ;; +down) + $RESOLVCONF -d "${dev}.inet" + ;; +esac diff --git a/vpn.sh b/vpn.sh new file mode 100755 index 000000000000..ee1794b77927 --- /dev/null +++ b/vpn.sh @@ -0,0 +1,5 @@ +#!/bin/sh +if [ "$1" == "pre" ] +then + killall openvpn +fi |