Skip to content

Instantly share code, notes, and snippets.

@kripul
Last active September 15, 2022 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kripul/cb5141bd729031e54a7f4f9bc6f069c1 to your computer and use it in GitHub Desktop.
Save kripul/cb5141bd729031e54a7f4f9bc6f069c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# CREATED By NIXPOIN.COM
#
while :
do
echo "Apa yang ingin anda lakukan"
echo " 1) auth init"
echo " 2) auth switch"
echo " 3) droplet ls"
echo " 4) droplet RM"
echo " 5) droplet power-cycle"
echo " 6) droplet power-off"
echo " 7) cek saldo"
read -p "Pilih [1]: " PILIHCOMMAND
case "$PILIHCOMMAND" in
1|"")
read -p "masukkan nama alias : " IDALIAS
doctl auth init --context $IDALIAS
doctl auth switch --context $IDALIAS
doctl balance get
doctl compute droplet ls --format ID,Name,PublicIPv4,Memory,Region,Status
;;
2)
read -p "masukkan nama alias : " IDALIAS
doctl auth switch --context $IDALIAS
doctl compute droplet ls
;;
3)
doctl compute droplet ls --format ID,Name,PublicIPv4,Memory,Region,Status;;
4)
read -p "masukkan droplet id yang ingin dihapus : " IDDROPLET
doctl compute droplet rm $IDDROPLET -f
;;
5)
read -p "masukkan droplet id yang ingin direstart : " IDDROPLET
doctl compute droplet-action power-cycle $IDDROPLET
;;
6)
read -p "masukkan droplet id yang ingin dimatikan : " IDDROPLET
doctl compute droplet-action power-off $IDDROPLET
;;
7)
doctl balance get
;;
*) echo "pilihan salah"; exit;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment