From 5c8a32ebb3fd4870cdbab9814f8b83f80e2530f5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 5 Jul 2021 19:03:43 -0400 Subject: terminate --- bin/terminate | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/bin/terminate b/bin/terminate index 01e1e3c..b2e30b7 100755 --- a/bin/terminate +++ b/bin/terminate @@ -6,24 +6,27 @@ script_path="$(realpath "$(dirname "$0")")" secrets_bin="${script_path}/secrets" case "$1" in - tozt|algo|mail) - "$secrets_bin" open - trap '"$secrets_bin" close' EXIT - case "$1" in - tozt) - hostname=tozt.net - ;; - algo) - hostname=algo.tozt.net - ;; - mail) - hostname=mail.tozt.net - ;; - esac - doctl -t "$(cat /mnt/digitalocean)" compute droplet delete "$hostname" +tozt | algo | mail | mail2) + "$secrets_bin" open + trap '"$secrets_bin" close' EXIT + case "$1" in + tozt) + hostname=tozt.net ;; - *) - echo "unknown host $1" >&2 - exit 1 + algo) + hostname=algo.tozt.net ;; + mail) + hostname=mail.tozt.net + ;; + mail2) + hostname=mail2.tozt.net + ;; + esac + doctl -t "$(cat /mnt/digitalocean)" compute droplet delete "$hostname" + ;; +*) + echo "unknown host $1" >&2 + exit 1 + ;; esac -- cgit v1.2.3