#!/bin/bash . ./env.sh services=("$CONTAINER_PREFIX-$CONTAINER_SERVICE.service" "$CONTAINER_PREFIX-$CONTAINER_DB.service" ) for service in "${services[@]}"; do if systemctl --user list-units --full --all | grep -q "$service"; then echo "Stopping $service..." systemctl --user stop $service echo "$service stopped." fi done containers=( "$CONTAINER_SERVICE" "$CONTAINER_DB" ) for container in "${containers[@]}"; do if podman container exists "$container"; then echo "Stop and delete existing container $container" if podman inspect -f '{{.State.Running}}' "$container" | grep -q true; then podman stop "$container" fi podman rm "$container" fi done for service in "${services[@]}"; do systemctl --user disable --now $service rm $USER_SYSTEMD/$service done sudo rm -r $SERVICE_DIR crontab -l | grep -v "$APP_DIR/$BACKUP_FILE" | crontab - echo "Uninstall complete. Manually run haproxy config to rebuild config. Manually remove data directory - $APP_DIR - $HOME/.local/backup/$CONTAINER_PREFIX if needed."