Files
linux-install-helper/vaultwarden/uninstall.sh

24 lines
856 B
Bash
Raw Normal View History

#!/bin/bash
2025-05-04 17:23:02 +02:00
. ./env.sh
if systemctl --user list-units --full --all | grep -q "vaultwarden-${CONTAINER_NAME}.service"; then
systemctl --user stop vaultwarden-${CONTAINER_NAME}.service
fi
if podman container exists "$CONTAINER_NAME"; then
echo "Stop and delete existing container $CONTAINER_NAME"
if podman inspect -f '{{.State.Running}}' "$CONTAINER_NAME" | grep -q true; then
podman stop "$CONTAINER_NAME"
fi
podman rm "$CONTAINER_NAME"
fi
systemctl --user disable --now vaultwarden-$CONTAINER_NAME.service
rm $USER_SYSTEMD/vaultwarden-$CONTAINER_NAME.service
systemctl --user daemon-reload
sudo rm -r $SERVICE_DIR
crontab -l | grep -v "$VW_FOLDER/$BACKUP_FILE" | crontab -
echo "Uninstall complete. Manually run haproxy config to rebuild config. Manually remove data directory $VW_FOLDER and $HOME/.local/backup if needed."