From 6754ec0385a2d31a8a03a866ed0332e8ab42e1d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Wed, 20 Dec 2017 20:38:59 +0000 Subject: [PATCH] Setup port in glorytun-setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- README.md | 2 ++ systemd/glorytun-setup | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6392ae3..f358a8a 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ First, setup the server: $ sudo glorytun-setup Config filename (tun0): Server ip (enter for server conf): + Bind to port (5000): Server key (enter to generate a new one): Your new key: NEW_KEY Start glorytun now ? (enter to skip): y @@ -40,6 +41,7 @@ Copy the new generated key and use it when configuring the client: $ sudo glorytun-setup Config filename (tun0): Server ip (enter for server conf): SERVER_IP + Server port (5000): Server key (enter to generate a new one): NEW_KEY Start glorytun now ? (enter to skip): y diff --git a/systemd/glorytun-setup b/systemd/glorytun-setup index 660464c..a3650b3 100755 --- a/systemd/glorytun-setup +++ b/systemd/glorytun-setup @@ -16,6 +16,13 @@ if [ -f /etc/glorytun/"$NAME" ]; then fi _ask "Server ip (enter for server conf)" HOST +if [ -z "$HOST" ]; then + _ask "Bind to port (5000)" BIND_PORT + BIND_PORT=${BIND_PORT:-5000} +else + _ask "Server port (5000)" PORT + PORT=${PORT:-5000} +fi _ask "Server key (enter to generate a new one)" KEY if [ -z "$KEY" ]; then @@ -27,7 +34,9 @@ fi mkdir -p /etc/glorytun cat > /etc/glorytun/"$NAME" <