mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 22:46: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
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
dir='/run/service'
|
||||||
|
svc_path() (
|
||||||
|
cd "${dir}"
|
||||||
|
realpath -e -s "$@"
|
||||||
|
)
|
||||||
|
|
||||||
if [ 0 -eq $# ]
|
if [ 0 -eq $# ]
|
||||||
then
|
then
|
||||||
set -- \
|
set -- \
|
||||||
/run/service/tubesync*-worker \
|
$( cd "${dir}" && svc_path tubesync*-worker ) \
|
||||||
/run/service/gunicorn \
|
"$( svc_path gunicorn )" \
|
||||||
/run/service/nginx
|
"$( svc_path nginx )"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for service in "$@"
|
for service in $( svc_path "$@" )
|
||||||
do
|
do
|
||||||
printf 1>&2 -- 'Restarting %s... ' "${service}"
|
printf -- 'Restarting %s...' "${service#${dir}/}"
|
||||||
/command/s6-svc -wr -r "${service}"
|
/command/s6-svc -wr -r "${service}"
|
||||||
printf 1>&2 -- 'completed.\n'
|
printf -- '\tcompleted.\n'
|
||||||
done
|
done
|
||||||
unset -v service
|
unset -v service
|
||||||
|
Loading…
Reference in New Issue
Block a user