2022-07-20 21:18:02 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#set -e # Exit immediately if a command exits with a non-zero status.
|
|
|
|
|
|
|
|
# Prompt to confirm
|
|
|
|
echo "This will reset your system to factory defaults. Are you sure you want to do this? (y/n)"
|
2022-09-21 21:18:30 +00:00
|
|
|
read -r confirm
|
2022-07-20 21:18:02 +00:00
|
|
|
if [ "$confirm" != "y" ]; then
|
|
|
|
echo "Aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-09-21 21:18:30 +00:00
|
|
|
ROOT_FOLDER="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")"/..)"
|
2022-07-20 21:18:02 +00:00
|
|
|
|
|
|
|
# Stop Tipi
|
|
|
|
"${ROOT_FOLDER}/scripts/stop.sh"
|
|
|
|
|
|
|
|
echo y | docker system prune
|
|
|
|
echo y | docker volume prune
|
|
|
|
echo y | docker network prune
|
|
|
|
echo y | docker container prune
|
|
|
|
echo y | docker image prune -a
|
|
|
|
|
|
|
|
# Remove everything in app-data folder
|
|
|
|
rm -rf "${ROOT_FOLDER}/app-data"
|
2022-07-26 21:19:39 +00:00
|
|
|
rm -rf "${ROOT_FOLDER}/data/postgres"
|
2022-07-20 21:18:02 +00:00
|
|
|
mkdir -p "${ROOT_FOLDER}/app-data"
|
|
|
|
|
2022-09-21 21:18:30 +00:00
|
|
|
cd "$ROOT_FOLDER" || echo ""
|
2022-07-20 21:18:02 +00:00
|
|
|
"${ROOT_FOLDER}/scripts/start.sh"
|