summaryrefslogtreecommitdiffstats
path: root/bin/terminate
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-04-24 02:07:29 -0400
committerJesse Luehrs <doy@tozt.net>2020-04-24 02:07:29 -0400
commit0f9f21c0f34395e35ba67eab5a36addf58b51495 (patch)
treebed79c56f6bdaba6f126d5fb129216749c069314 /bin/terminate
parentf555b450ca61449695302cea97a3842ee4caf756 (diff)
downloadpuppet-tozt-0f9f21c0f34395e35ba67eab5a36addf58b51495.tar.gz
puppet-tozt-0f9f21c0f34395e35ba67eab5a36addf58b51495.zip
use hostnames for droplet names
this is how you convince digitalocean to set up proper reverse dns
Diffstat (limited to 'bin/terminate')
-rwxr-xr-xbin/terminate15
1 files changed, 13 insertions, 2 deletions
diff --git a/bin/terminate b/bin/terminate
index 2b100c1..01e1e3c 100755
--- a/bin/terminate
+++ b/bin/terminate
@@ -6,10 +6,21 @@ script_path="$(realpath "$(dirname "$0")")"
secrets_bin="${script_path}/secrets"
case "$1" in
- base|tozt|algo|mail|partofme)
+ tozt|algo|mail)
"$secrets_bin" open
trap '"$secrets_bin" close' EXIT
- doctl -t "$(cat /mnt/digitalocean)" compute droplet delete "$1"
+ 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"
;;
*)
echo "unknown host $1" >&2