Scripts for managing DigitalOcean droplets, databases, and firewalls.
- doctl
- dig
Before using this script, you must first authenticate with DigitalOcean. To do so, run:
doadm -I
To create a droplet with the name droplet-1
, run:
doadm -cdn droplet-1
To expunge the droplet with the name droplet-1
, run:
doadm -xdn droplet-1
To display the list of droplets, run:
doadm -ld
To create the PostgreSQL database mimix-db-1
, run:
doadm -cbn mimix-db-1
To destroy the PostgreSQL database mimix-db-1
, run:
doadm -xbn mimix-db-1
To display the list of databases, run:
doadm -lb
To create or apply the firewall mimix
to the droplets droplet-1
and droplet-2
,
allowing access from your public IP address and 62.5.13.190
only, on the ports 22
, 80
, and
443
, run:
doadm -cfn mimix -a droplet-1,droplet-2 -SA 62.5.13.190 -P 22,80,443
To expel droplet-2
from the firewall mimix
, run:
doadm -cfn mimix -X droplet-2
To expunge the firewall mimix
and its association with any droplet, run:
doadm -xfn mimix
To display the list of firewalls, run:
doadm -lf
To create a subdomain home
under the TLD streamsharing.io
, pointing to 161.35.122.135
, run:
doadm -cDn streamsharing.io -s home -A 161.35.122.135
To expunge the subdomain home
from streamsharing.io
, run:
doadm -xDn streamsharing.io -s home
To list the domains under streamsharing.io
, run:
doadm -lDn streamsharing.io
To display usage summary, run:
doadm --help