From cf467c346b4640df78881a8e258d697bcfbbce90 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Sun, 8 Mar 2020 19:08:19 +0000 Subject: [PATCH] check peer exists before removal --- README.md | 3 ++- remove.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index da79011..b246695 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/remove.go b/remove.go index 7ce7ff6..c67b4d4 100644 --- a/remove.go +++ b/remove.go @@ -10,11 +10,10 @@ func Remove() { ExitFail("Hostname argument required: dsnet remove ") } - 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) }