Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Henrik Hautakoski <henrik@eossweden.org>
Cc: wireguard@lists.zx2c4.com
Subject: Re: [PATCH] wg-quick: linux: add restart command.
Date: Thu, 17 Aug 2023 03:29:02 +0500	[thread overview]
Message-ID: <20230817032902.0d2f7a29@nvm> (raw)
In-Reply-To: <20230816050653.28972-1-henrik@eossweden.org>

On Wed, 16 Aug 2023 07:06:53 +0200
Henrik Hautakoski <henrik@eossweden.org> wrote:

> 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

cmd_down and the lines prior use a TAB to indent, but cmd_up uses 4 spaces
instead.

-- 
With respect,
Roman

  reply	other threads:[~2023-08-16 22:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16  5:06 Henrik Hautakoski
2023-08-16 22:29 ` Roman Mamedov [this message]
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=20230817032902.0d2f7a29@nvm \
    --to=rm@romanrm.net \
    --cc=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).