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>
32 lines
969 B
Bash
Executable File
32 lines
969 B
Bash
Executable File
#!/bin/bash
|
|
|
|
copyFile()
|
|
{
|
|
local silent_flag="$1"
|
|
local file="$2"
|
|
local file_name=$(basename "$file")
|
|
local save_dir="$3"
|
|
local save_dir_file=$(basename "$save_dir")
|
|
local clean_dir=$(echo "$save_dir" | sed 's#//*#/#g')
|
|
local user_name="$4"
|
|
local flags="$5"
|
|
|
|
if [[ $flags == "overwrite" ]]; then
|
|
flags_full="-f"
|
|
fi
|
|
|
|
if [ "$silent_flag" == "loud" ]; then
|
|
local result=$(sudo cp $flags_full "$file" "$save_dir")
|
|
checkSuccess "Copying $file_name to $(basename "$save_dir")"
|
|
elif [ "$silent_flag" == "silent" ]; then
|
|
local result=$(sudo cp $flags_full "$file" "$save_dir")
|
|
fi
|
|
|
|
if [ "$silent_flag" == "loud" ]; then
|
|
local result=$(sudo chown $user_name:$user_name "$save_dir")
|
|
checkSuccess "Updating $save_dir_file with $user_name ownership"
|
|
elif [ "$silent_flag" == "silent" ]; then
|
|
local result=$(sudo chown $user_name:$user_name "$save_dir")
|
|
fi
|
|
}
|