[jitsi] fix /federated/bin/stop jitsi

FIXME: This should really go to a jitsi specific file when
we revise the core scripts
This commit is contained in:
Bernhard "bero" Rosenkränzer (Boggins) 2024-11-18 22:36:03 +01:00
parent 379daec85a
commit a64e298ee7

View File

@ -44,10 +44,16 @@ if [ "$SERVICE" = "all" ]; then
[ ! -d "/federated/apps/$i" ] && continue
# If app is already stopped then skip
# If app is jitsi then check status of jitsi-web-1 or jitsi-jvb-1
if [ "$i" = "jitsi" ]; then
if [ "$JITSI_SCALE" = "server" ]; then
[ ! "$(docker ps -f "name=jitsi-jvb-1" -f "status=running" -q)" ] && echo "* $i is already stopped." && continue
else
[ ! "$(docker ps -f "name=jitsi-web-1" -f "status=running" -q)" ] && echo "* $i is already stopped." && continue
fi
else
[ ! "$(docker ps -f "name=$i" -f "status=running" -q)" ] && echo "* $i is already stopped." && continue
# If app is jitsi then check status of jitsi_web_1 since jitsi is named different
[ "$i" = "jitsi" ] && [ ! "$(docker ps -f "name=jitsi_web_1" -f "status=running" -q)" ] && echo "* $i is already stopped." && continue
fi
# Run thread in stopservice_all function
stopservice_all "$i" &
@ -59,10 +65,16 @@ fi
if printf '%s\0' "${SERVICES[@]}" | grep -Fxqz -- "$SERVICE"; then
# If app is already stopped then skip
# If app is jitsi then check status of jitsi-web-1 or jitsi-jvb-1
if [ "$SERVICE" = "jitsi" ]; then
if [ "$JITSI_SCALE" = "server" ]; then
[ ! "$(docker ps -f "name=jitsi-jvb-1" -f "status=running" -q)" ] && echo "* $SERVICE is already stopped." && exit 2
else
[ ! "$(docker ps -f "name=jitsi-web-1" -f "status=running" -q)" ] && echo "* $SERVICE is already stopped." && exit 2
fi
else
[ ! "$(docker ps -f "name=$SERVICE" -f "status=running" -q)" ] && echo "* $SERVICE is already stopped." && exit 2
# If app is jitsi then check status of jitsi_web_1 since jitsi is named different
[ "$SERVICE" = "jitsi" ] && [ ! "$(docker ps -f "name=jitsi_web_1" -f "status=running" -q)" ] && echo "* $SERVICE is already stopped." && exit 2
fi
# Stop service
stopservice "$SERVICE"