summaryrefslogtreecommitdiff
path: root/user/tipidee/tipidee.initd
diff options
context:
space:
mode:
authorLaurent Bercot <ska-adelie@skarnet.org>2024-04-15 16:10:12 +0000
committerZach van Rijn <me@zv.io>2024-04-25 02:48:27 +0000
commit503e8ce2cbe2e0498f9227e5da4e9a50d9de6b61 (patch)
tree83bd8ec7631c1ad3b384423d0ad95af8b4f9afd4 /user/tipidee/tipidee.initd
parent0d5a660ecab48aa1174dc3e82e95c27b8d11db79 (diff)
downloadpackages-503e8ce2cbe2e0498f9227e5da4e9a50d9de6b61.tar.gz
packages-503e8ce2cbe2e0498f9227e5da4e9a50d9de6b61.tar.bz2
packages-503e8ce2cbe2e0498f9227e5da4e9a50d9de6b61.tar.xz
packages-503e8ce2cbe2e0498f9227e5da4e9a50d9de6b61.zip
user/tipidee: new package
Diffstat (limited to 'user/tipidee/tipidee.initd')
-rw-r--r--user/tipidee/tipidee.initd65
1 files changed, 65 insertions, 0 deletions
diff --git a/user/tipidee/tipidee.initd b/user/tipidee/tipidee.initd
new file mode 100644
index 000000000..ebd0787a7
--- /dev/null
+++ b/user/tipidee/tipidee.initd
@@ -0,0 +1,65 @@
+#!/sbin/openrc-run
+
+description="Start/stop the tipidee services"
+
+depend()
+{
+ after net
+ after localmount
+}
+
+_get_services()
+{
+ . /etc/conf.d/tipidee
+ list=
+ if "$HTTP" ; then
+ if test -n "$TIPIDEED_IPv4" ; then
+ list="httpd-4"
+ fi
+ if test -n "$TIPIDEED_IPv6" ; then
+ list="$list httpd-6"
+ fi
+ fi
+ if "$HTTPS" ; then
+ if test -n "$TIPIDEED_IPV4" ; then
+ list="httpsd-4"
+ fi
+ if test -n "$TIPIDEED_IPV6" ; then
+ list="$list httpsd-6"
+ fi
+ fi
+ echo $list
+}
+
+stop()
+{
+ ebegin "Stopping the tipidee services"
+ for i in `_get_services` ; do
+ s6-svunlink /run/service "$i"
+ done
+ eend $?
+}
+
+start()
+{
+ ebegin "Starting the tipidee services"
+ for i in `_get_services` ; do
+ s6-svlink -t10000 /run/service "/var/lib/tipidee/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
+}