Browse Source

fix(docker): 兼容旧版默认路径 compatibility of old default config path (#487)

Update entrypoint.sh
New Future 5 months ago
parent
commit
ed68bafc08
1 changed files with 12 additions and 0 deletions
  1. 12 0
      docker/entrypoint.sh

+ 12 - 0
docker/entrypoint.sh

@@ -2,6 +2,18 @@
 
 if [ $# -eq 0 ]; then
   printenv > /etc/environment
+  if [ -f /config.json ]; then
+    echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+    if [ ! -f /ddns/config.json ]; then
+      ln -s /config.json /ddns/config.json
+      echo "WARNING: /ddns/config.json not found. Created symlink to /config.json."
+    fi
+     echo "WARNING: From v4.0.0, the working dir is /ddns/"
+     echo "WARNING: Please map your host folder to /ddns/"
+     echo "[old] -v /host/folder/config.json:/config.json"
+     echo "[new] -v /host/folder/:/ddns/"
+     echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
+  fi
   echo "*/5 * * * *  cd /ddns && /bin/ddns" > /etc/crontabs/root
   /bin/ddns &&  echo "Cron daemon will run every 5 minutes..." && exec crond -f
 else