2023-01-18 16:43:21 -08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
uci_bash_shell_etc_copy () {
|
2023-01-20 17:17:55 -08:00
|
|
|
install_dir=${install_dir:-"$(dirname $(dirname $(realpath "${BASH_SOURCE:-$0}")))"}
|
2023-01-18 16:43:21 -08:00
|
|
|
echo -e "************ copying uci shell profile and bash.bashrc files to /etc ********"
|
|
|
|
files=$(find $BASH_SHELL_BASE/install/files/etc/ -maxdepth 1 -type f)
|
|
|
|
for file in $files; do install -m 644 -o root -g root $file /etc; done
|
|
|
|
echo setting BASH_SHELL_BASE to $BASH_SHELL_BASE in etc/bash.bashrc and /etc/profile
|
|
|
|
sed -i 's:_BASH_SHELL_BASE_:'${BASH_SHELL_BASE}':' /etc/bash.bashrc
|
|
|
|
sed -i 's:BASH_SHELL_BASE=.*:BASH_SHELL_BASE='${BASH_SHELL_BASE}':' /etc/profile
|
|
|
|
echo -e "************ copying uci shell profile.d/ files /etc/profile.d/ ********"
|
|
|
|
files=$(find $BASH_SHELL_BASE/install/files/etc/profile.d -maxdepth 1 -type f)
|
|
|
|
for file in $files; do install -m 644 -o root -g root $file /etc/profile.d; done
|
|
|
|
}
|
|
|
|
|
|
|
|
# # if script was executed then call the function
|
|
|
|
(return 0 2>/dev/null) || uci_bash_shell_etc_copy "$@"
|