Skip to content

rtgiskard/net_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my personal network utils

this util currently support some of the basic operation with the api of digitalocean and zerotier:

  • digitalocean

    1. list/create/delete

    2. reboot/poweron/poweroff/powercycle

  • zerotier

    1. get account info

    2. network: list/create/delete/config

    3. network member: list/delete/config

refer to ./net_utils -h for details

Config file

the config file provide some neccessary info and default settings for operation, some of which can be override with commandline arguments

make sure config.toml is present in current working directory or specify the path with -c config or it will not run

Examples

# config file and script tool is relative to the working dir
cd utils

# build binary: net_utils
go build

# check default config
./net_utils info

# zerotier: account info
./net_utils zerotier info

# zerotier: add network
./net_utils zerotier net_add --name net_01

# zerotier: list network members
./net_utils zerotier netm_ls --nid "$NETWORK_ID"

# zerotier: set network member ip and name
./net_utils zerotier netm_set --nid "NETWORK_ID" --mid "MEMBER_ID" --ip 10.10.10.2 --name node_02

# digitalocean: list droplet
./net_utils digitalocean ls

# digitalocean: create droplet abc.01 with file as userdata source
./net_utils digitalocean add --name abc.01 --userdata "$path_to_userdata_file"

# digitalocean: create droplet abc.01 with generated userdata (the generator script should
# be present in the path relative to current working dir: `../tool/01_gen_userdata.sh`)
./net_utils digitalocean add --name abc.01 --userdata gen --helper ../tool/01_gen_userdata.sh

# digitalocean: destroy droplet: abc.01
./net_utils digitalocean rm --name abc.01

# digitalocean: reboot droplet: abc.01
./net_utils digitalocean reboot --name abc.01

About

my personal network utils

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published