Skip to content

Commit

Permalink
Add rever local repo helper
Browse files Browse the repository at this point in the history
  • Loading branch information
evertramos committed Sep 22, 2023
1 parent 2c2b444 commit 1ae3600
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bin/revert.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

#
# This script revert the fresh start script to git branch
#
# Source: https://github.com/evertramos/nginx-proxy-automation
#

# Get the script name and its real file path
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
SCRIPT_NAME="${0##*/}"
CURRENT_PATH=$(pwd)

# Go to script path if not there
cd "${SCRIPT_PATH}/../"

# Stop compose
export COMPOSE_INTERACTIVE_NO_CLI=1
docker compose down 2&> /dev/null || true

# Remove newly created files/folder
sudo rm -rf ./data .env docker-compose.yml.backup_* .env.backup_* .env

# Restore docker-compose.yml
git restore docker-compose.yml

echo 'Repo restored!'

exit 0

0 comments on commit 1ae3600

Please sign in to comment.