2022-11-05 16:10:19 -07:00
|
|
|
#!/bin/bash
|
|
|
|
# Remove existing containers to ensure clean environment
|
2023-03-27 09:27:46 -07:00
|
|
|
for service in /home/joey/homelab/jafner-net/config/*
|
2022-11-05 16:10:19 -07:00
|
|
|
do
|
|
|
|
echo "CLEANING UP $service"
|
|
|
|
cd $service
|
|
|
|
docker-compose down
|
|
|
|
done
|
|
|
|
|
|
|
|
# Check for good connection to NAS and shares mounted properly.
|
|
|
|
SMB_SHARES="/mnt/nas/av
|
|
|
|
/mnt/nas/calibre
|
|
|
|
/mnt/nas/calibre-web
|
|
|
|
/mnt/nas/media
|
|
|
|
/mnt/nas/torrenting"
|
|
|
|
|
|
|
|
for share in $SMB_SHARES;
|
|
|
|
do
|
|
|
|
if ! mount | awk -v DIR="$share" '{if ($3 == DIR) { exit 0}} ENDFILE{exit -1}'; then
|
|
|
|
echo "Share not mounted: $share"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "STARTING DOCKER SERVICES"
|
2023-03-27 09:27:46 -07:00
|
|
|
for service in /home/joey/homelab/jafner-net/config/*
|
2022-11-05 16:10:19 -07:00
|
|
|
do
|
|
|
|
echo "===== STARTING $service ====="
|
|
|
|
cd $service
|
|
|
|
docker-compose up -d
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "================ ALL DONE ================="
|
|
|
|
echo "======= List all running containers ======="
|
|
|
|
|
|
|
|
# wish I didn't have to do this
|
|
|
|
# the exporters boot faster than the servers, and don't seem to retry.
|
|
|
|
wait 10
|
|
|
|
docker container restart monitoring_exporter-plex
|
2023-01-24 09:36:28 -08:00
|
|
|
docker container restart keycloak_forwardauth
|
|
|
|
docker container restart keycloak_forwardauth-privileged
|