Add purge command to remove all config files

This commit is contained in:
Paul-Christian Volkmer 2022-12-02 16:36:24 +01:00
parent f45cc7985d
commit 61dbd439a7
2 changed files with 12 additions and 1 deletions

View File

@ -92,7 +92,12 @@ $ docker-compose run wg show 1
### Remove configuration and create new one from scratch ### 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 ## Client configurations

View File

@ -41,6 +41,11 @@ case "$1" in
/scripts/show-client.sh $2 /scripts/show-client.sh $2
exit 0 exit 0
;; ;;
'purge')
cd /etc/wireguard
rm *.conf *.png
exit 0
;;
'help') 'help')
echo "Usage: <Command> [<Arguments>]" echo "Usage: <Command> [<Arguments>]"
echo echo
@ -50,6 +55,7 @@ case "$1" in
echo "add Add new client" echo "add Add new client"
echo "rm Remove client by ID" echo "rm Remove client by ID"
echo "show Show client config with qrcode" echo "show Show client config with qrcode"
echo "purge Remove server config and all client configs"
echo "help Show this help message" echo "help Show this help message"
echo echo
;; ;;