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
|
* Hooks for adding routes/ IPtables forwarding rules
|
||||||
* Route entire internet option
|
* 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
|
* 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>")
|
ExitFail("Hostname argument required: dsnet remove <hostname>")
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfirmOrAbort("Do you really want to remove %s?", os.Args[2])
|
|
||||||
|
|
||||||
conf := MustLoadDsnetConfig()
|
conf := MustLoadDsnetConfig()
|
||||||
hostname := os.Args[2]
|
hostname := os.Args[2]
|
||||||
conf.MustRemovePeer(hostname)
|
conf.MustRemovePeer(hostname)
|
||||||
|
ConfirmOrAbort("Do you really want to remove %s?", os.Args[2])
|
||||||
conf.MustSave()
|
conf.MustSave()
|
||||||
ConfigureDevice(conf)
|
ConfigureDevice(conf)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user