[fix] Add rebuilding the container as a generic "fix" attempt

This commit is contained in:
Bernhard "bero" Rosenkränzer (Boggins) 2025-02-18 14:30:17 +01:00
parent daa834162d
commit ecb625f57d

14
bin/fix
View File

@ -28,7 +28,8 @@ if /federated/bin/check ${SERVICE}; then
exit 0 exit 0
fi fi
[ -e /federated/services/${SERVICE}/fix ] && . /federated/services/${SERVICE}/fix if [ -e /federated/services/${SERVICE}/fix ]; then
. /federated/services/${SERVICE}/fix
if /federated/bin/check ${SERVICE}; then if /federated/bin/check ${SERVICE}; then
echo "${SERVICE} was (probably) fixed by the service fix script" echo "${SERVICE} was (probably) fixed by the service fix script"
@ -42,6 +43,17 @@ if /federated/bin/check ${SERVICE}; then
echo "${SERVICE} was (probably) fixed by restarting after running the fix script" echo "${SERVICE} was (probably) fixed by restarting after running the fix script"
exit 0 exit 0
fi fi
fi
docker compose -f /federated/apps/${SERVICE}/docker-compose.yml down
docker rm ${SERVICE}
/federated/bin/stop ${SERVICE} || :
/federated/bin/start ${SERVICE}
if /federated/bin/check ${SERVICE}; then
echo "${SERVICE} was (probably) fixed by rebuilding the container"
exit 0
fi
echo "${SERVICE} is still broken. Please improve the fix script." echo "${SERVICE} is still broken. Please improve the fix script."
exit 1 exit 1