diff options
author | 6543 | 2020-07-18 18:44:18 +0200 |
---|---|---|
committer | 6543 | 2020-07-18 18:44:18 +0200 |
commit | d113e3b3063a181c63fb775ce9c6443fab983a74 (patch) | |
tree | 8bc518aa622824709fb85fa2e4aaf0e6cf48488f /i2p.initd | |
download | aur-d113e3b3063a181c63fb775ce9c6443fab983a74.tar.gz |
i2p-openrc-1-0-any
Diffstat (limited to 'i2p.initd')
-rw-r--r-- | i2p.initd | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/i2p.initd b/i2p.initd new file mode 100644 index 000000000000..c19d9cc6193f --- /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; +} |