summaryrefslogtreecommitdiff
path: root/yams
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-07 12:39:22 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-07 12:39:22 -0300
commit9acf1af0a240df9e4389351b3d337800ccc592e9 (patch)
treec31702b622c54b59b55f79b91eb0eafcb8df6f9f /yams
parentacce9fd85cc0113ff9f115c0f611c2ca923f13f6 (diff)
Added destroy to yams script
Diffstat (limited to 'yams')
-rwxr-xr-xyams21
1 files changed, 18 insertions, 3 deletions
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