From 9acf1af0a240df9e4389351b3d337800ccc592e9 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 7 Jan 2023 12:39:22 -0300 Subject: Added destroy to yams script --- yams | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'yams') diff --git a/yams b/yams index 0f43ef4..94ae558 100755 --- a/yams +++ b/yams @@ -11,9 +11,10 @@ help() { echo "Usage: yams [--help|restart|stop|start|status]" echo "options:" echo "--help displays this help message" - echo "restart restarts yams" - echo "stop stops yams" - echo "start starts yams" + echo "restart restarts yams services" + echo "stop stops all yams services" + echo "start starts yams services" + echo "destroy destroy yams services so you can start from scratch" } if [ $option == "--help" ]; then @@ -35,3 +36,17 @@ if [ $option == "start" ]; then $dc up -d exit 0 fi + +if [ $option == "destroy" ]; then + echo + echo + read -p "Are you sure you want to destroy all your yams services? THIS IS NOT RECOVERABLE! ⚠️ ️🚨 [y/N]: " destroy_now + destroy_now=${destroy_now:-"n"} + if [ $destroy_now == "y" ]; then + $dc down + echo + echo + echo "yams services were destroyed. To restart, run: " + echo "\$ yams start" + fi +fi -- cgit v1.2.3