2023-01-18 16:43:21 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
uci_bash_shell_install () {
|
|
|
|
local usesudo
|
|
|
|
export install_dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
|
|
|
|
export BASH_SHELL_BASE="$(dirname $install_dir)"
|
|
|
|
# export BASH_SHELL_BASE="$(dirname "$(cd "$(dirname "${BASH_SOURCE:-$0}")" >/dev/null 2>&1 ; pwd -P )")"
|
|
|
|
echo "Detected The UCI BASH Shell install directory: BASH_INSTALL_DIR=$install_dir"
|
|
|
|
echo "Detected The UCI BASH Shell base directory: BASH_SHELL_BASE=$BASH_SHELL_BASE"
|
2024-02-27 19:04:33 -08:00
|
|
|
[[ $EUID -ne 0 ]] && usesudo="sudo -m"
|
|
|
|
$usesudo $SHELL $install_dir/scripts/copy-etc.sh
|
|
|
|
$usesudo $SHELL $install_dir/scripts/copy-root.sh
|
2024-02-27 18:53:59 -08:00
|
|
|
[[ $1 ]] && [[ $(id -u $1 2> /dev/null) ]] && $usesudo -m $SHELL $install_dir/scripts/copy-user.sh "$@"
|
2023-01-18 16:43:21 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
# # if script was executed then call the function
|
|
|
|
(return 0 2>/dev/null) || uci_bash_shell_install "$@"
|