librelad 875a60f90f LibrePortal v0.1.0 — initial release
A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys,
Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun
VPN routing, and a web dashboard to manage it all.

Free & open forever to self-host; optional paid hosted services fund it.
See PROMISE.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-21 20:37:54 +01:00

27 lines
787 B
Bash
Executable File

#!/bin/bash
copyFolders()
{
local source="$1"
local save_dir="$2"
local user_name="$3"
local clean_dir=$(echo "$save_dir" | sed 's#//*#/#g')
# Ensure the source path is expanded to a list of subdirectories
local subdirs=($(find "$source" -mindepth 1 -maxdepth 1 -type d))
if [ ${#subdirs[@]} -eq 0 ]; then
echo "No subdirectories found in the source directory: $source"
fi
for subdir in "${subdirs[@]}"; do
local subdir_name=$(basename "$subdir")
local result=$(sudo cp -rf "$subdir" "$save_dir")
checkSuccess "Copying $subdir_name to $save_dir"
local result=$(sudo chown -R $user_name:$user_name "$save_dir/$subdir_name")
checkSuccess "Updating $subdir_name with $user_name ownership"
done
}