summaryrefslogtreecommitdiff
path: root/openrc/joeac.net
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2026-06-26 14:08:37 +0100
committerJoe Carstairs <me@joeac.net>2026-06-29 07:32:35 +0100
commitc6ff40e28894417d87ee7858438f28fc262ffb40 (patch)
tree6709abcec3a294c5a0d6fa56f91ecb3fdf573d5e /openrc/joeac.net
parent86509e2598fc5689b00b770e793c348988b32187 (diff)
moves openrc -> openrc/init.d
Diffstat (limited to 'openrc/joeac.net')
-rwxr-xr-xopenrc/joeac.net64
1 files changed, 0 insertions, 64 deletions
diff --git a/openrc/joeac.net b/openrc/joeac.net
deleted file mode 100755
index 3a45694..0000000
--- a/openrc/joeac.net
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/sbin/openrc-run
-# credits:
-# https://gist.github.com/itzwam/2069e935385193207f7e5bea7156e21d
-# https://github.com/0x17de/dockerservice-openrc
-
-: ${MODULENAME:=${RC_SVCNAME##*.}}
-: ${SRCDIR:=/usr/local/lib/joeac.net}
-DOCKER_COMPOSE_UP_ARGS=${DOCKER_COMPOSE_UP_ARGS-"--no-build --no-recreate --no-deps"}
-
-[ -z "${MODULENAME}" ] && exit 1
-: ${COMPOSEFILE:="${SRCDIR}/compose.yml"}
-: ${MAKEFILE:="${SRCDIR}/Makefile"}
-COMPOSECMD="/usr/bin/podman-compose"
-export COMPOSE_HTTP_TIMEOUT=300
-
-description="Manage dockerservices defined in ${COMPOSEFILE}"
-extra_commands="configtest"
-description_configtest="Check configuration via \"podman-compose -f ${COMPOSEFILE} config\""
-
-configtest() {
- if ! [ -f "${COMPOSEFILE}" ]; then
- eerror "The docker-compose file ${COMPOSEFILE} does not exist!"
- return 1
- fi
- if "${COMPOSECMD}" -f "${COMPOSEFILE}" config >&/dev/null; then
- einfo "config: ok"
- else
- eerror "config: error"
- return 1
- fi
-}
-
-start() {
- configtest || return 1
- ebegin "Starting ${MODULENAME}"
- "${COMPOSECMD}" -f "${COMPOSEFILE}" up -d ${DOCKER_COMPOSE_UP_ARGS} ${MODULENAME}
- eend $?
-}
-
-stop() {
- ebegin "Stopping ${MODULENAME}"
- "${COMPOSECMD}" -f "${COMPOSEFILE}" down --timeout=5 ${MODULENAME}
- eend $?
-}
-
-status() {
- pods=0
- started=0
- while read pod; do
- pods=$(($pods+1))
- if podman top $pod &>/dev/null; then
- einfo "status: [$pod] started"
- started=$(($started+1))
- else
- einfo "status: [$pod] stopped"
- fi
- done < <("${COMPOSECMD}" -f "${COMPOSEFILE}" ps --quiet ${MODULENAME})
- if [ $started -eq $pods ]; then
- einfo "status: started"
- else
- einfo "status: stopped"
- return 3
- fi
-}