summaryrefslogtreecommitdiff
path: root/user/apaste/apasted.initd
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2024-02-24 08:53:33 +0000
committerLaurent Bercot <ska-adelie@skarnet.org>2024-02-24 08:57:44 +0000
commitf6caef65cb23c157fa195a56a648235a8af37531 (patch)
tree1b1d7541270b3f5fb603187e34d7a0aacd2640c6 /user/apaste/apasted.initd
parentca35fa1a22f117398f176d5ecbb2259aab28ab4c (diff)
downloadpackages-f6caef65cb23c157fa195a56a648235a8af37531.tar.gz
packages-f6caef65cb23c157fa195a56a648235a8af37531.tar.bz2
packages-f6caef65cb23c157fa195a56a648235a8af37531.tar.xz
packages-f6caef65cb23c157fa195a56a648235a8af37531.zip
user/apaste: new package
Diffstat (limited to 'user/apaste/apasted.initd')
-rw-r--r--user/apaste/apasted.initd65
1 files changed, 65 insertions, 0 deletions
diff --git a/user/apaste/apasted.initd b/user/apaste/apasted.initd
new file mode 100644
index 000000000..106c2b11a
--- /dev/null
+++ b/user/apaste/apasted.initd
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+
+description="Start/stop the apasted services"
+
+depend()
+{
+ after net
+ after localmount
+}
+
+_get_services()
+{
+ . /etc/conf.d/apasted
+ list=
+ if test -n "$APASTED_PORT" ; then
+ if test -n "$APASTED_IPv4" ; then
+ list="apasted-4"
+ fi
+ if test -n "$APASTED_IPv6" ; then
+ list="$list apasted-6"
+ fi
+ fi
+ if test -n "$APASTED_TLS_PORT" ; then
+ if test -n "$APASTED_IPV4" ; then
+ list="apastesd-4"
+ fi
+ if test -n "$APASTED_IPV6" ; then
+ list="$list apastesd-6"
+ fi
+ fi
+ echo $list
+}
+
+stop()
+{
+ ebegin "Stopping the apasted services"
+ for i in `_get_services` ; do
+ s6-svunlink /run/service "$i"
+ done
+ eend $?
+}
+
+start()
+{
+ ebegin "Starting the apasted services"
+ for i in `_get_services` ; do
+ s6-svlink -t10000 /run/service "/var/lib/apasted/services/$i"
+ done
+ eend $?
+}
+
+status()
+{
+ for i in `_get_services` ; do
+ echo -n "${i}: "
+ s6-svstat "/run/service/${i}"
+ done
+}
+
+restart()
+{
+ for i in `_get_services` ; do
+ s6-svc -rwR "/run/service/$i"
+ done
+}