From 60e961dc9351baeb2734ec3f214a7d45bc2b924f Mon Sep 17 00:00:00 2001 From: Devanshu Panigrahi Date: Sun, 14 Jul 2024 16:54:05 +0530 Subject: [PATCH] Update README.md Automatically retrieve and use the server's public IP address in the Docker run command - Added a step to dynamically fetch the server's public IP address using curl. - Updated the Docker run command to use the retrieved IP address for the WG_HOST environment variable. --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8eca2f8..c5f1892c 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ If you haven't installed Docker yet, install it by running: ```bash curl -sSL https://get.docker.com | sh sudo usermod -aG docker $(whoami) +exit ``` And log in again. @@ -59,10 +60,12 @@ And log in again. To automatically install & run wg-easy, simply run: ``` - docker run -d \ +IP=$(curl -s http://checkip.amazonaws.com) + +docker run -d \ --name=wg-easy \ -e LANG=en \ - -e WG_HOST=<🚨YOUR_SERVER_IP> \ + -e WG_HOST=$IP \ -e PASSWORD_HASH=<🚨YOUR_ADMIN_PASSWORD_HASH> \ -e PORT=51821 \ -e WG_PORT=51820 \