mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 14:36:34 +00:00
Resolve paths for me from service names
This commit is contained in:
parent
19f277e628
commit
09fea17791
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user