summarylogtreecommitdiffstats
diff options
context:
space:
mode:
author65432020-07-18 18:44:18 +0200
committer65432020-07-18 18:44:18 +0200
commitd113e3b3063a181c63fb775ce9c6443fab983a74 (patch)
tree8bc518aa622824709fb85fa2e4aaf0e6cf48488f
downloadaur-d113e3b3063a181c63fb775ce9c6443fab983a74.tar.gz
i2p-openrc-1-0-any
-rw-r--r--.SRCINFO14
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD16
-rw-r--r--i2p.initd41
4 files changed, 75 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..a8a125dfc40
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = i2p-openrc
+ pkgdesc = i2p init scripts for OpenRC
+ pkgver = 1
+ pkgrel = 0
+ url = https://aur.archlinux.org/packages/i2p-openrc/
+ arch = any
+ license = GPL3
+ depends = i2p
+ depends = openrc
+ source = i2p.initd
+ sha1sums = 861e18a13cd1d765e3e542a74c858753c84f704e
+
+pkgname = i2p-openrc
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..8b191952fb6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+src/
+pkg/
+
+*.pkg.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..71344c8d2b2
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,16 @@
+# Maintainer: 6543 <6543 at obermui dot de>
+pkgname=i2p-openrc
+pkgver=1
+pkgrel=0
+pkgdesc="i2p init scripts for OpenRC"
+arch=('any')
+url="https://aur.archlinux.org/packages/i2p-openrc/"
+license=('GPL3')
+groups=()
+depends=('i2p' 'openrc')
+source=('i2p.initd')
+sha1sums=('5e15a3066bf111e07fc8f8f8c385b54eafe5f960')
+
+package() {
+ install -Dm755 ${srcdir}/i2p.initd "$pkgdir"/etc/init.d/i2p
+}
diff --git a/i2p.initd b/i2p.initd
new file mode 100644
index 00000000000..c19d9cc6193
--- /dev/null
+++ b/i2p.initd
@@ -0,0 +1,41 @@
+#!/usr/bin/openrc-run
+# Distributed under the terms of the GNU General Public License v3
+
+user="${user:-i2p}"
+group="${group:-i2p}"
+pidfile="/run/i2p/$RC_SVCNAME.pid"
+command="/usr/bin/java-service-wrapper"
+command_args="/opt/i2p/wrapper.config wrapper.name=i2prouter wrapper.syslog.ident=i2prouter wrapper.daemonize=TRUE TZ=UTC"
+command_background=1
+
+depend() {
+ use net
+ need localmount
+}
+
+start() {
+ ebegin "Start ${SVCNAME}"
+
+ su -s /bin/sh -c "$command $command_args" $user
+
+ eend $?
+ return 0;
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+
+ /bin/kill -TERM $(cat $pidfile)
+
+ eend $?
+ return 0;
+}
+
+reload() {
+ ebegin "Reload ${SVCNAME}"
+
+ /bin/kill -USR1 $(cat $pidfile)
+
+ eend $?
+ return 0;
+}