addon-base/base/rootfs/usr/bin/service
Felipe Santos 113f723c02
Upgrade s6-overlay from 2.2.0.3 to 3.1.0.1 (#176)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-06-07 13:23:25 +02:00

32 lines
685 B
Bash
Executable file

#!/bin/bash
# ==============================================================================
# Home Assistant Community Add-on: Base Images
# This script patches all service commands into the appropriate s6- commands
# ==============================================================================
start() {
s6-svc -wU -u -T2500 "/run/service/${service}"
}
stop() {
s6-svc -wD -d -T2500 "/run/service/${service}"
}
restart() {
stop
start
}
status() {
s6-svstat "/run/service/${service}"
}
service="$1"
command="$2"
if [[ ! -d "/run/service/${service}" ]] ; then
echo "s6 service not found for ${service}, exiting..."
exit
fi;
${command} "${service}"