2 Commits
v2.1 ... main

Author SHA1 Message Date
116a9574ce Merge branch 'Beta-2.1' 2025-09-04 11:23:59 +00:00
6c7216c0e1 Hotfix - default copy 2025-09-04 13:18:42 +02:00

View File

@ -6,27 +6,26 @@ NC="\033[0m"
copy_default_config() { copy_default_config() {
echo "[~] Checking configuration directory..." echo "[~] Checking configuration directory..."
if [ ! -d "/app/config" ]; then mkdir -p /app/config
mkdir -p /app/config
fi
echo "[~] Checking if default config files/folders need to be copied..." echo "[~] Checking if default config files/folders need to be copied..."
files_copied=false files_copied=false
# Recursively check all files and folders in /app/default for src in $(find /app/default -mindepth 1); do
while IFS= read -r src; do
relpath="${src#/app/default/}" relpath="${src#/app/default/}"
target="/app/config/$relpath" target="/app/config/$relpath"
if [ ! -e "$target" ]; then if [ ! -e "$target" ]; then
echo "[→] Copying: $relpath" echo "[→] Copying: $relpath"
if [ -d "$src" ]; then if [ -d "$src" ]; then
cp -r "$src" "$target" mkdir -p "$target"
cp -r "$src/" "$target/"
else else
mkdir -p "$(dirname "$target")"
cp "$src" "$target" cp "$src" "$target"
fi fi
files_copied=true files_copied=true
fi fi
done < <(find /app/default -mindepth 1) done
if [ "$files_copied" = true ]; then if [ "$files_copied" = true ]; then
echo "[✓] Default configuration files/folders copied successfully." echo "[✓] Default configuration files/folders copied successfully."