docker-pi-hole/s6/service

31 lines
635 B
Plaintext
Raw Normal View History

2017-01-09 02:13:16 +01:00
#!/bin/bash
2017-05-05 05:37:26 +02:00
# This script patches all service commands into the appropriate s6- commands
# pi-hole upstream scripts need a 'service' interface. why not systemd? docker said so.
start() {
s6-svc -wU -u -T2500 /var/run/s6/services/$service
2017-01-09 02:13:16 +01:00
}
2017-05-05 05:37:26 +02:00
stop() {
s6-svc -wD -d -T2500 /var/run/s6/services/$service
2017-01-09 02:13:16 +01:00
}
2017-05-05 05:37:26 +02:00
restart() {
stop
start
#s6-svc -t -wR -T5000 /var/run/s6/services/$service
2017-01-09 02:13:16 +01:00
}
status() {
2017-05-05 05:37:26 +02:00
s6-svstat /var/run/s6/services/$service
2017-01-09 02:13:16 +01:00
}
service="$1"
command="$2"
2017-05-05 05:37:26 +02:00
if [[ ! -d "/var/run/s6/services/$service" ]] ; then
echo "s6 service not found for $service, exiting..."
exit
fi;
${command} "${service}"