check peer exists before removal
This commit is contained in:
parent
4fd8d5f99d
commit
cf467c346b
@ -32,5 +32,6 @@ TODO after first release:
|
||||
|
||||
* Hooks for adding routes/ IPtables forwarding rules
|
||||
* Route entire internet option
|
||||
* Support for additional subnets in peer config (with routes)
|
||||
* Support for additional subnets in peer config (with routes) in separate networks section in report
|
||||
* Peer endpoint support
|
||||
* Decide what to do with assumed default DNS server
|
||||
|
@ -10,11 +10,10 @@ func Remove() {
|
||||
ExitFail("Hostname argument required: dsnet remove <hostname>")
|
||||
}
|
||||
|
||||
ConfirmOrAbort("Do you really want to remove %s?", os.Args[2])
|
||||
|
||||
conf := MustLoadDsnetConfig()
|
||||
hostname := os.Args[2]
|
||||
conf.MustRemovePeer(hostname)
|
||||
ConfirmOrAbort("Do you really want to remove %s?", os.Args[2])
|
||||
conf.MustSave()
|
||||
ConfigureDevice(conf)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user