should be working gitea
This commit is contained in:
@@ -2,24 +2,40 @@
|
||||
|
||||
. ./env.sh
|
||||
|
||||
if systemctl --user list-units --full --all | grep -q "${CONTAINER_PREFIX}-${CONTAINER_NAME}.service"; then
|
||||
systemctl --user stop ${CONTAINER_PREFIX}-${CONTAINER_NAME}.service
|
||||
fi
|
||||
services=("$CONTAINER_PREFIX-$CONTAINER_GITEA.service"
|
||||
"$CONTAINER_PREFIX-$CONTAINER_DB.service"
|
||||
)
|
||||
|
||||
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"
|
||||
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
|
||||
podman rm "$CONTAINER_NAME"
|
||||
done
|
||||
|
||||
containers=(
|
||||
"$CONTAINER_GITEA"
|
||||
"$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
|
||||
|
||||
systemctl --user disable --now ${CONTAINER_PREFIX}-$CONTAINER_NAME.service
|
||||
rm $USER_SYSTEMD/${CONTAINER_PREFIX}-$CONTAINER_NAME.service
|
||||
systemctl --user daemon-reload
|
||||
for service in "${services[@]}"; do
|
||||
systemctl --user disable --now $service
|
||||
rm $USER_SYSTEMD/$service
|
||||
done
|
||||
|
||||
# sudo rm -r $SERVICE_DIR
|
||||
# crontab -l | grep -v "$VW_FOLDER/$BACKUP_FILE" | crontab -
|
||||
sudo rm -r $SERVICE_DIR
|
||||
crontab -l | grep -v "$GITEA_FOLDER/$BACKUP_FILE" | crontab -
|
||||
|
||||
echo "Uninstall complete. Manually run haproxy config to rebuild config. Manually remove data directory
|
||||
- $GITEA_FOLDER
|
||||
|
||||
Reference in New Issue
Block a user