Resolve paths for me from service names

This commit is contained in:
tcely 2025-04-10 13:30:17 -04:00 committed by GitHub
parent 19f277e628
commit 09fea17791
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,17 +1,23 @@
#!/usr/bin/env sh
dir='/run/service'
svc_path() (
cd "${dir}"
realpath -e -s "$@"
)
if [ 0 -eq $# ]
then
set -- \
/run/service/tubesync*-worker \
/run/service/gunicorn \
/run/service/nginx
$( cd "${dir}" && svc_path tubesync*-worker ) \
"$( svc_path gunicorn )" \
"$( svc_path nginx )"
fi
for service in "$@"
for service in $( svc_path "$@" )
do
printf 1>&2 -- 'Restarting %s... ' "${service}"
printf -- 'Restarting %s...' "${service#${dir}/}"
/command/s6-svc -wr -r "${service}"
printf 1>&2 -- 'completed.\n'
printf -- '\tcompleted.\n'
done
unset -v service