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