diff options
-rwxr-xr-x | bin/terminate | 39 |
1 files 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 |