diff options
author | pokrasko | 2020-10-20 08:48:41 +0300 |
---|---|---|
committer | pokrasko | 2020-10-20 09:00:52 +0300 |
commit | 2297fc158694763225ae08f47b09ae81542adea1 (patch) | |
tree | 49b4db4a12f11e11d80514b868463b57d6847930 | |
download | aur-nordvpn-s6.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 33 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | nordvpn-log.conf | 2 | ||||
-rw-r--r-- | nordvpn-log.consumer-for | 1 | ||||
-rw-r--r-- | nordvpn-log.notification-fd | 1 | ||||
-rw-r--r-- | nordvpn-log.pipeline-name | 1 | ||||
-rw-r--r-- | nordvpn-log.run | 5 | ||||
-rw-r--r-- | nordvpn-log.type | 1 | ||||
-rw-r--r-- | nordvpn-srv.producer-for | 1 | ||||
-rw-r--r-- | nordvpn-srv.run | 3 | ||||
-rw-r--r-- | nordvpn-srv.type | 1 | ||||
-rw-r--r-- | nordvpn.install | 13 |
12 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..34006699c8a8 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,33 @@ +pkgbase = nordvpn-s6 + pkgdesc = s6 service scripts for nordvpn-bin + pkgver = 20201020 + pkgrel = 1 + install = nordvpn.install + arch = any + depends = nordvpn-bin + depends = s6 + optdepends = wireguard-tools: necessary for NordLynx support + provides = nordvpn-runscripts + conflicts = nordvpn-runscripts + backup = etc/s6/sv/nordvpn-log/conf + source = nordvpn-log.conf + source = nordvpn-log.consumer-for + source = nordvpn-log.notification-fd + source = nordvpn-log.pipeline-name + source = nordvpn-log.run + source = nordvpn-log.type + source = nordvpn-srv.producer-for + source = nordvpn-srv.run + source = nordvpn-srv.type + sha256sums = 8a3d2abcc40d355ca913f39871d24f6c770dd216fe075d2548e729b2ae952135 + sha256sums = ed40de44d786b0fe425ae2db45562ee5581fbda38cae3c7bf93020ee82afd1eb + sha256sums = 1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2 + sha256sums = 8b6e9f57a45c6722dfa6c7b2dcf232f57fd1af3f7a47bac66f1d0665d504635f + sha256sums = b3ebbd11813452d23176c259615d5091f9ddbf7d4287ffb16a8c1d03b6fe04e2 + sha256sums = d0001a150b83f68f09004c5059045cb76a3f064eed4d42ce072bc3722c118006 + sha256sums = c53437039c650267959acb7f100accb782d9dcb75d1e31e1936f854e8e6e3996 + sha256sums = d83c555a010a2ba531de17105b3845fbb12960e0025074f38fdad5f9fd9f4f1b + sha256sums = d0001a150b83f68f09004c5059045cb76a3f064eed4d42ce072bc3722c118006 + +pkgname = nordvpn-s6 + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..9d682620ea9e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: pokrasko <dpokrasko at gmail dot com> +pkgname=nordvpn-s6 +pkgver=20201020 +pkgrel=1 +pkgdesc="s6 service scripts for nordvpn-bin" +arch=('any') +depends=('nordvpn-bin' 's6') +optdepends=('wireguard-tools: necessary for NordLynx support') +provides=('nordvpn-runscripts') +conflicts=('nordvpn-runscripts') +backup=('etc/s6/sv/nordvpn-log/conf') +install=nordvpn.install +source=("nordvpn-log.conf" + "nordvpn-log.consumer-for" + "nordvpn-log.notification-fd" + "nordvpn-log.pipeline-name" + "nordvpn-log.run" + "nordvpn-log.type" + "nordvpn-srv.producer-for" + "nordvpn-srv.run" + "nordvpn-srv.type") +sha256sums=('8a3d2abcc40d355ca913f39871d24f6c770dd216fe075d2548e729b2ae952135' + 'ed40de44d786b0fe425ae2db45562ee5581fbda38cae3c7bf93020ee82afd1eb' + '1121cfccd5913f0a63fec40a6ffd44ea64f9dc135c66634ba001d10bcf4302a2' + '8b6e9f57a45c6722dfa6c7b2dcf232f57fd1af3f7a47bac66f1d0665d504635f' + 'b3ebbd11813452d23176c259615d5091f9ddbf7d4287ffb16a8c1d03b6fe04e2' + 'd0001a150b83f68f09004c5059045cb76a3f064eed4d42ce072bc3722c118006' + 'c53437039c650267959acb7f100accb782d9dcb75d1e31e1936f854e8e6e3996' + 'd83c555a010a2ba531de17105b3845fbb12960e0025074f38fdad5f9fd9f4f1b' + 'd0001a150b83f68f09004c5059045cb76a3f064eed4d42ce072bc3722c118006') + +_inst_sv(){ + for file in conf consumer-for notification-fd \ + pipeline-name producer-for run type; do + if test -f "$srcdir/$1.$file"; then + install -Dm644 "$srcdir/$1.$file" "$pkgdir/etc/s6/sv/$1/$file" + fi + done +} + +package() { + _inst_sv 'nordvpn-log' + _inst_sv 'nordvpn-srv' + + echo "tun" | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf" +} diff --git a/nordvpn-log.conf b/nordvpn-log.conf new file mode 100644 index 000000000000..565bdae8e3ff --- /dev/null +++ b/nordvpn-log.conf @@ -0,0 +1,2 @@ +# This configures the directives used for s6-log in the log service. +DIRECTIVES="n3 s2000000 T" diff --git a/nordvpn-log.consumer-for b/nordvpn-log.consumer-for new file mode 100644 index 000000000000..1cafe679afd3 --- /dev/null +++ b/nordvpn-log.consumer-for @@ -0,0 +1 @@ +nordvpn-srv diff --git a/nordvpn-log.notification-fd b/nordvpn-log.notification-fd new file mode 100644 index 000000000000..00750edc07d6 --- /dev/null +++ b/nordvpn-log.notification-fd @@ -0,0 +1 @@ +3 diff --git a/nordvpn-log.pipeline-name b/nordvpn-log.pipeline-name new file mode 100644 index 000000000000..ab53a21b6591 --- /dev/null +++ b/nordvpn-log.pipeline-name @@ -0,0 +1 @@ +nordvpn diff --git a/nordvpn-log.run b/nordvpn-log.run new file mode 100644 index 000000000000..08f6aec94d77 --- /dev/null +++ b/nordvpn-log.run @@ -0,0 +1,5 @@ +#!/usr/bin/execlineb -P +foreground { if -n -t { test -d /var/log/nordvpn } install -d -m 0755 -o s6log -g s6log /var/log/nordvpn } +envfile /etc/s6/sv/nordvpn-log/conf +importas -sCiu DIRECTIVES DIRECTIVES +s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/nordvpn diff --git a/nordvpn-log.type b/nordvpn-log.type new file mode 100644 index 000000000000..5883cff0cd15 --- /dev/null +++ b/nordvpn-log.type @@ -0,0 +1 @@ +longrun diff --git a/nordvpn-srv.producer-for b/nordvpn-srv.producer-for new file mode 100644 index 000000000000..3982d24c5f9a --- /dev/null +++ b/nordvpn-srv.producer-for @@ -0,0 +1 @@ +nordvpn-log diff --git a/nordvpn-srv.run b/nordvpn-srv.run new file mode 100644 index 000000000000..1071ee060d0c --- /dev/null +++ b/nordvpn-srv.run @@ -0,0 +1,3 @@ +#!/usr/bin/execlineb -P +fdmove -c 2 1 +exec nordvpnd diff --git a/nordvpn-srv.type b/nordvpn-srv.type new file mode 100644 index 000000000000..5883cff0cd15 --- /dev/null +++ b/nordvpn-srv.type @@ -0,0 +1 @@ +longrun diff --git a/nordvpn.install b/nordvpn.install new file mode 100644 index 000000000000..89078b628f05 --- /dev/null +++ b/nordvpn.install @@ -0,0 +1,13 @@ +post_install() { + modprobe tun +} + +pre_remove() { + if [ -e "/run/service/nordvpn-srv" ]; then + s6-rc -d change nordvpn + fi +} + +post_remove() { + rmf -rf /etc/s6/sv/nordvpn-log +} |