Update 99-run.sh

This commit is contained in:
Alexandre
2025-11-29 19:56:22 +01:00
committed by GitHub
parent 277ad61267
commit a3bd29b316

View File

@@ -18,16 +18,12 @@ for folder in config db; do
# Migrate existing data from previous locations while avoiding self-copies
for legacy_path in "/app/${folder}" "/data/${folder}"; do
if [ -d "$legacy_path" ]; then
legacy_target="$(readlink -f "$legacy_path" || true)"
if [ "$legacy_target" != "$target" ] && [ "$(ls -A "$legacy_path")" ]; then
# -n prevents clobbering anything already present in /config
cp -rn "$legacy_path"/. "$target"/
fi
cp -rn "$legacy_path"/. "$target"/
rm -rf "$legacy_target"
fi
done
rm -rf /data/"$folder"
ln -sf "$target" /data/"$folder"
ln -sf "$target" /config/"$folder"
done
sudo chown -R nginx:www-data /config/db/