1 parent d88337e commit 0619ab4Copy full SHA for 0619ab4
1 file changed
init-freeradius.sh
@@ -66,13 +66,20 @@ function init_database {
66
67
echo "Starting freeradius..."
68
69
+# Remove the lock file to ensure initialization runs on every container start
70
+# This prevents issues when containers are recreated but volumes persist
71
+INIT_LOCK=/data/.freeradius_init_done
72
+if test -f "$INIT_LOCK"; then
73
+ echo "Removing existing lock file to ensure proper initialization on container restart."
74
+ rm -f "$INIT_LOCK"
75
+fi
76
+
77
# wait for MySQL-Server to be ready
78
while ! mysqladmin ping -h"$MYSQL_HOST" --silent; do
79
echo "Waiting for mysql ($MYSQL_HOST)..."
80
sleep 20
81
done
82
-INIT_LOCK=/data/.freeradius_init_done
83
if test -f "$INIT_LOCK"; then
84
echo "Init lock file exists, skipping initial setup."
85
else
0 commit comments