V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 2m1s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 2m1s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -23,16 +23,60 @@ guard_sourcing
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
accounts_setup_ciss() {
|
||||
accounts_setup_ciss_root() {
|
||||
### Declare Arrays, HashMaps, and Variables.
|
||||
declare var_target="${TARGET}"
|
||||
|
||||
### Check for TARGET / RECOVERY.
|
||||
[[ "${VAR_RUN_RECOVERY}" == "true" ]] && var_target="${RECOVERY}"
|
||||
|
||||
install -d -m 0700 -o root -g root "${var_target}/root/.ssh"
|
||||
install -m 0600 -o root -g root /dev/null "${var_target}/root/.ssh/authorized_keys"
|
||||
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss.bashrc" "${var_target}/root/.bashrc"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/theme_eza_ciss.yml" "${var_target}/root/.ciss/"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/alias" "${var_target}/root/.ciss/"
|
||||
install -m 0700 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/check_chrony.sh" "${var_target}/root/.ciss/"
|
||||
install -m 0700 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/clean_logout.sh" "${var_target}/root/.ciss/"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/f2bchk" "${var_target}/root/.ciss/"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/scan_libwrap" "${var_target}/root/.ciss/"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss/shortcuts" "${var_target}/root/.ciss/"
|
||||
|
||||
insert_comments "${var_target}/root/.bashrc"
|
||||
insert_comments "${var_target}/root/.ciss/alias"
|
||||
insert_comments "${var_target}/root/.ciss/check_chrony.sh"
|
||||
insert_comments "${var_target}/root/.ciss/clean_logout.sh"
|
||||
insert_comments "${var_target}/root/.ciss/f2bchk"
|
||||
insert_comments "${var_target}/root/.ciss/scan_libwrap"
|
||||
insert_comments "${var_target}/root/.ciss/shortcuts"
|
||||
|
||||
if [[ "${user_root_shell}" == "/bin/zsh" ]]; then
|
||||
|
||||
if [[ -x "${var_target}${user_root_shell}" ]]; then
|
||||
|
||||
zsh_omz_installer "root" "${var_target}"
|
||||
mkdir -p "${var_target}/root/.ciss/cdi/backup/root"
|
||||
mv "${var_target}/root/.zshrc" "${var_target}/root/.ciss/cdi/backup/root/.zshrc.bak"
|
||||
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/root/.ciss.zshrc" "${var_target}/root/.zshrc"
|
||||
insert_comments "${var_target}/root/.zshrc"
|
||||
|
||||
chroot_exec "${var_target}" chsh -s "${user_root_shell}" root
|
||||
do_log "info" "file_only" "4520() Shell: '${user_root_shell}' used for: 'root'."
|
||||
|
||||
else
|
||||
|
||||
chroot_exec "${var_target}" chsh -s /bin/bash root
|
||||
do_log "info" "file_only" "4520() Shell: '${user_root_shell}' not found for: 'root'. Using '/bin/bash' instead."
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
do_log "info" "file_only" "4520() Skeleton: 'root' successfully generated."
|
||||
|
||||
guard_dir && return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f accounts_setup_ciss
|
||||
readonly -f accounts_setup_ciss_root
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user