From: Henrik Hautakoski <henrik@eossweden.org>
To: wireguard@lists.zx2c4.com
Cc: Henrik Hautakoski <henrik@eossweden.org>
Subject: [PATCH] wg-quick: linux: add restart command.
Date: Wed, 16 Aug 2023 07:06:53 +0200 [thread overview]
Message-ID: <20230816050653.28972-1-henrik@eossweden.org> (raw)
Add a simple "restart" command that just do cmd_down followed by an cmd_up. Saves abit of typing :)
Signed-off-by: Henrik Hautakoski <henrik@eossweden.org>
---
src/wg-quick/linux.bash | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/wg-quick/linux.bash b/src/wg-quick/linux.bash
index 69e5bef..cc9f288 100755
--- a/src/wg-quick/linux.bash
+++ b/src/wg-quick/linux.bash
@@ -298,7 +298,7 @@ execute_hooks() {
cmd_usage() {
cat >&2 <<-_EOF
- Usage: $PROGRAM [ up | down | save | strip ] [ CONFIG_FILE | INTERFACE ]
+ Usage: $PROGRAM [ up | down | restart | save | strip ] [ CONFIG_FILE | INTERFACE ]
CONFIG_FILE is a configuration file, whose filename is the interface name
followed by \`.conf'. Otherwise, INTERFACE is an interface name, with
@@ -373,6 +373,11 @@ elif [[ $# -eq 2 && $1 == down ]]; then
auto_su
parse_options "$2"
cmd_down
+elif [[ $# -eq 2 && $1 == restart ]]; then
+ auto_su
+ parse_options "$2"
+ cmd_down
+ cmd_up
elif [[ $# -eq 2 && $1 == save ]]; then
auto_su
parse_options "$2"
--
2.40.1
next reply other threads:[~2023-08-16 22:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 5:06 Henrik Hautakoski [this message]
2023-08-16 22:29 ` Roman Mamedov
2023-08-17 1:52 ` [PATCH v1] " Henrik Hautakoski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230816050653.28972-1-henrik@eossweden.org \
--to=henrik@eossweden.org \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).