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