Clean up - no need for all the duplicated statements

This commit is contained in:
Bernhard "bero" Rosenkränzer (Boggins) 2025-01-18 18:15:49 +01:00
parent c18b598980
commit 4c7719433b

View File

@ -45,43 +45,26 @@ startservice_jitsi() {
}
startservice() {
echo -ne "* Starting $SERVICE.."
local ALERT
if [ -z "$ALERTS_EMAIL" ]; then
spin &
SPINPID=$!
if [ "$SERVICE" = "traefik" ] && [ "$PLUS" ]; then
docker compose -f /federated/apps/traefik/docker-compose.yml -p traefik up -d &> /dev/null
disown $SPINPID &> /dev/null
kill -9 $SPINPID &> /dev/null
echo -ne "done.\n"
else
NC_COMMAND=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $4 }'`
RETRY=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $6 }'`
eval start_service_withalert "$SERVICE" "$NC_COMMAND" "$RETRY" "no"
disown $SPINPID &> /dev/null
kill -9 $SPINPID &> /dev/null
echo -ne "done."
fi
ALERT="yes"
else
spin &
SPINPID=$!
if [ "$SERVICE" = "traefik" ] && [ "$PLUS" ]; then
docker compose -f /federated/apps/traefik/docker-compose.yml -p traefik up -d &> /dev/null
disown $SPINPID &> /dev/null
kill -9 $SPINPID &> /dev/null
echo -ne "done.\n"
else
NC_COMMAND=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $4 }'`
RETRY=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $6 }'`
eval start_service_withalert "$SERVICE" "$NC_COMMAND" "$RETRY" "yes"
disown $SPINPID &> /dev/null
kill -9 $SPINPID &> /dev/null
echo -ne "done.\n"
fi
ALERT="no"
fi
spin &
SPINPID=$!
if [ "$SERVICE" = "traefik" ] && [ "$PLUS" ]; then
docker compose -f /federated/apps/traefik/docker-compose.yml -p traefik up -d &> /dev/null
else
NC_COMMAND=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $4 }'`
RETRY=`grep start_service /federated/lib/$SERVICE.sh | awk -F\" '{ print $6 }'`
eval start_service_withalert "$SERVICE" "$NC_COMMAND" "$RETRY" "$ALERT"
fi
disown $SPINPID &> /dev/null
kill -9 $SPINPID &> /dev/null
echo "done."
}
startservice_all() {
for SERVICE in "${SERVICES[@]}"; do