V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m46s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-10-15 23:37:48 +01:00
parent 3e934a017e
commit cbf472c4dd
10 changed files with 143 additions and 102 deletions

View File

@@ -15,8 +15,10 @@ guard_sourcing
#######################################
# Prepare '/etc/skel'-Directory.
# Globals:
# RECOVERY
# TARGET
# VAR_SETUP_PATH
# VAR_RUN_RECOVERY
# VAR_USER_ROOT_SPECIFIC
# Arguments:
# None
# Returns:
@@ -24,39 +26,32 @@ guard_sourcing
#######################################
accounts_preparation() {
### Declare Arrays, HashMaps, and Variables.
declare -r var_logfile="/root/.ciss/cdi/log/4130_installation_toolset.log"
declare -r var_logfile="/root/.ciss/cdi/log/4500_accounts_preparation.sh.log"
declare var_target="${TARGET}"
chroot_logger "${TARGET}${var_logfile}"
### Check for TARGET / RECOVERY.
[[ "${VAR_RUN_RECOVERY}" == "true" ]] && var_target="${RECOVERY}"
chroot_script "${TARGET}" "
chroot_logger "${var_target}${var_logfile}"
chroot_script "${var_target}" "
export INITRD=No
apt-get install -y --no-install-recommends --no-install-suggests bash-completion fzf 2>&1 | tee -a ${var_logfile}
"
mkdir -p "${TARGET}/etc/skel/.ciss"
mkdir -p "${var_target}/etc/skel/.ciss"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.bashrc" "${TARGET}/etc/skel/.bashrc"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.zshrc" "${TARGET}/etc/skel/.zshrc"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/theme_eza_ciss.yml" "${TARGET}/etc/skel/.ciss/"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/alias" "${TARGET}/etc/skel/.ciss/"
install -m 0700 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/check_chrony.sh" "${TARGET}/etc/skel/.ciss/"
install -m 0700 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/clean_logout.sh" "${TARGET}/etc/skel/.ciss/"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/f2bchk" "${TARGET}/etc/skel/.ciss/"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/scan_libwrap" "${TARGET}/etc/skel/.ciss/"
install -m 0600 -o root -g root "${VAR_SETUP_PATH}/includes/target/etc/skel/.ciss/shortcuts" "${TARGET}/etc/skel/.ciss/"
case "${VAR_USER_ROOT_SPECIFIC}" in
insert_comments "${TARGET}/etc/skel/.bashrc"
insert_comments "${TARGET}/etc/skel/.zshrc"
insert_comments "${TARGET}/etc/skel/.ciss/alias"
insert_comments "${TARGET}/etc/skel/.ciss/check_chrony.sh"
insert_comments "${TARGET}/etc/skel/.ciss/clean_logout.sh"
insert_comments "${TARGET}/etc/skel/.ciss/f2bchk"
insert_comments "${TARGET}/etc/skel/.ciss/scan_libwrap"
insert_comments "${TARGET}/etc/skel/.ciss/shortcuts"
"ciss") accounts_preparation_ciss ;;
### In order to be able to copy/paste from vim, one needs to create a '.vimrc' in every home directory with the following content:
echo 'set clipboard=unnamed' >| "${TARGET}/etc/skel/.vimrc"
chmod 0600 "${TARGET}/etc/skel/.vimrc"
"physnet") accounts_preparation_physnet ;;
"none") do_log "info" "file_only" "4500() Account preparation [none] selected." ;;
*) do_log "warn" "file_only" "4500() Account preparation nothing selected. Keeping defaults." ;;
esac
guard_dir && return 0
}