diff --git a/README.md b/README.md index b5cfef8..82474c1 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,12 @@ $ docker-compose run wg show 1 ### Remove configuration and create new one from scratch -Remove existing config files or rename device in `docker-compose.yml`. Run command `docker-compose up` again. +Stop the service and run the following command to remove existing config files. + +``` +$ docker-compose run wg purge +``` +Run command `docker-compose up` again to generate new config files. ## Client configurations diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 4a9878e..dc81c9d 100755 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -41,6 +41,11 @@ case "$1" in /scripts/show-client.sh $2 exit 0 ;; + 'purge') + cd /etc/wireguard + rm *.conf *.png + exit 0 + ;; 'help') echo "Usage: []" echo @@ -50,6 +55,7 @@ case "$1" in echo "add Add new client" echo "rm Remove client by ID" echo "show Show client config with qrcode" + echo "purge Remove server config and all client configs" echo "help Show this help message" echo ;;