aboutsummaryrefslogtreecommitdiffstats
path: root/community/namecoin/namecoin.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/namecoin/namecoin.initd')
-rw-r--r--community/namecoin/namecoin.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/community/namecoin/namecoin.initd b/community/namecoin/namecoin.initd
new file mode 100644
index 0000000000..9bdeea0893
--- /dev/null
+++ b/community/namecoin/namecoin.initd
@@ -0,0 +1,38 @@
+#!/sbin/runscript
+
+# Namecoin init.d file for Alpine Linux.
+
+name=namecoind
+daemon=/usr/bin/$name
+config=/etc/namecoin.conf
+user=namecoin
+group=namecoin
+## supercedes datadir set in $config ##
+datadir=/var/lib/namecoin
+pidfile=/var/run/namecoin/$name.pid
+
+depend() {
+ need net
+ after logger firewall
+}
+
+start() {
+ ebegin "Starting ${name}"
+ # enforce permissions
+ checkpath -q -d ${pidfile%/*} -o ${user}:${group}
+ checkpath -q -d ${datadir} -m 0700 -o ${user}:${group}
+ checkpath -q -f ${config} -m 0600 -o ${user}:${group}
+ start-stop-daemon --start --quiet \
+ --pidfile ${pidfile} \
+ --user ${user}:${group} \
+ --exec ${daemon} -- -conf=${config} -datadir=${datadir} -pid=${pidfile}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${name}"
+ start-stop-daemon --stop --quiet \
+ --pidfile ${pidfile} \
+ --exec ${daemon}
+ eend $?
+}