After restarting container, it will try to regenerate WireGuard conf from Database

This commit is contained in:
Shahrad Elahi
2023-09-26 03:01:07 +03:30
parent 34050ed173
commit 734b0c8e02
7 changed files with 82 additions and 32 deletions

View File

@@ -12,7 +12,7 @@ ulimit -c 0
# Checking if there is /data folder
if [ ! -d "/data" ]; then
mkdir -p /data
chmod 744 /data
chmod 700 /data
fi
# Starting Redis server in detached mode
@@ -26,4 +26,7 @@ if [ ! -z "$WG_HOST" ]; then
export NEXT_PUBLIC_WG_HOST=$WG_HOST
fi
# After 5 seconds, export the database to the WireGuard config file
screen -dm bash -c "sleep 5; curl -s -o /dev/null http://127.0.0.1:3000/api/wireguard/regen"
exec "$@"