From b03bbaa38561e790873de3adabc3d4405be17fb8 Mon Sep 17 00:00:00 2001
From: Guus Sliepen <guus@tinc-vpn.org>
Date: Sun, 21 Jul 2013 00:20:54 +0200
Subject: [PATCH] Allow extra options to be passed to "tinc restart" again.

---
 doc/tinc.8.in | 5 +++--
 doc/tinc.texi | 4 ++--
 src/tincctl.c | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/doc/tinc.8.in b/doc/tinc.8.in
index 2cff94c3..ebf9df19 100644
--- a/doc/tinc.8.in
+++ b/doc/tinc.8.in
@@ -106,9 +106,10 @@ optionally with the given extra options.
 .It stop
 Stop
 .Xr tincd 8 .
-.It restart
+.It restart Op tincd options
 Restart
-.Xr tincd 8 .
+.Xr tincd 8 ,
+optionally with the given extra options.
 .It reload
 Partially rereads configuration files. Connections to hosts whose host
 config files are removed are closed. New outgoing connections specified
diff --git a/doc/tinc.texi b/doc/tinc.texi
index a39e9ae6..a2952933 100644
--- a/doc/tinc.texi
+++ b/doc/tinc.texi
@@ -2238,8 +2238,8 @@ Start @samp{tincd}, optionally with the given extra options.
 @item stop
 Stop @samp{tincd}.
 
-@item restart
-Restart @samp{tincd}.
+@item restart [tincd options]
+Restart @samp{tincd}, optionally with the given extra options.
 
 @item reload
 Partially rereads configuration files. Connections to hosts whose host
diff --git a/src/tincctl.c b/src/tincctl.c
index 4349b79c..4c5102b2 100644
--- a/src/tincctl.c
+++ b/src/tincctl.c
@@ -116,7 +116,7 @@ static void usage(bool status) {
 				"  del VARIABLE [VALUE]       Remove VARIABLE [only ones with watching VALUE]\n"
 				"  start [tincd options]      Start tincd.\n"
 				"  stop                       Stop tincd.\n"
-				"  restart                    Restart tincd.\n"
+				"  restart [tincd options]    Restart tincd.\n"
 				"  reload                     Partially reload configuration of running tincd.\n"
 				"  pid                        Show PID of currently running tincd.\n"
 				"  generate-keys [bits]       Generate new RSA and ECDSA public/private keypairs.\n"
@@ -871,7 +871,7 @@ static int cmd_stop(int argc, char *argv[]) {
 }
 
 static int cmd_restart(int argc, char *argv[]) {
-	cmd_stop(argc, argv);
+	cmd_stop(1, argv);
 	return cmd_start(argc, argv);
 }
 
-- 
2.39.5