diff --git a/src/modules/kiauh/config b/src/modules/kiauh/config new file mode 100644 index 000000000..d1d86ae37 --- /dev/null +++ b/src/modules/kiauh/config @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +#### KIAUH Install Module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2022 - till today +#### https://github.com/mainsail-crew/MainsailOS +#### +#### This File is distributed under GPLv3 +#### + +#### All Credits to th33xitus for his great tool +#### https://github.com/th33xitus/kiauh + +# shellcheck disable=all + +# KIAUH repo +[[ -n "$KIAUH_REPO_SHIP" ]] || KIAUH_REPO_SHIP="https://github.com/th33xitus/kiauh.git" +[[ -n "$KIAUH_REPO_BRANCH" ]] || KIAUH_REPO_BRANCH="master" + +# Add to $PATH ? (1: yes, 0: no) +[[ -n "$KIAUH_ADD_TO_PATH" ]] || KIAUH_ADD_TO_PATH="1" diff --git a/src/modules/kiauh/start_chroot_script b/src/modules/kiauh/start_chroot_script new file mode 100644 index 000000000..742acc3d7 --- /dev/null +++ b/src/modules/kiauh/start_chroot_script @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +#### KIAUH Install Module +#### +#### Written by Stephan Wendel aka KwadFan +#### Copyright 2022 - till today +#### +#### This File is distributed under GPLv3 +#### + +#### All Credits to th33xitus for his great tool +#### https://github.com/th33xitus/kiauh + +# shellcheck enable=requires-variable-braces + +# Error handling +set -Ee + +# shellcheck disable=SC1091 +source /common.sh +install_cleanup_trap + + +echo_green "Installing sonar ..." + +## Step 1: Force apt update +apt-get update --allow-releaseinfo-change + +## Step 2: Make sure 'git' is installed! +check_install_pkgs git + +## Step 3: Move to Home Dir as WorkingDirectoy +pushd "/home/${BASE_USER}" &> /dev/null || exit 1 + +## Step 4: clone KIAUH repo +echo_green "Clone KIAUH repository ..." +gitclone KIAUH_REPO kiauh + +## Step 5: Link kiauh.sh in /usr/local/bin as kiauh +if [[ ${KIAUH_ADD_TO_PATH} = "1" ]]; then + echo_green "Add kiauh to PATH ..." + sudo ln -s "/home/${BASE_USER}/kiauh/kiauh.sh" "/usr/local/bin/kiauh" +fi + +## Finish +echo_green "Installing KIAUH ... DONE!" diff --git a/src/modules/postrename/filesystem/root/postrename b/src/modules/postrename/filesystem/root/postrename index 76474dd41..0cef0f1f9 100644 --- a/src/modules/postrename/filesystem/root/postrename +++ b/src/modules/postrename/filesystem/root/postrename @@ -166,6 +166,15 @@ fix_mainsailcfg_links() { ln -sf "${src_dir}/mainsail.cfg" "${config_dir}/mainsail.cfg" } +# Optional if kiauh module is used +fix_kiauh_links() { + local src_dir target_dir + src_dir="/home/${DEFAULT_USER}/kiauh" + target_dir="/usr/local/bin" + ln -sf "${src_dir}/kiauh.sh" "${target_dir}/kiauh" +} + + fix_cn_links() { local tools_dir tools_dir="/home/${DEFAULT_USER}/crowsnest/tools" @@ -231,6 +240,10 @@ echo -en "${WHITE}Fix broken symlinks ...${NOC}\r" fix_broken_links fix_timelapse_links fix_mainsailcfg_links +# Optional if kiauh module is used +if [[ -d "/home/${DEFAULT_USER}/kiauh" ]]; then + fix_kiauh_links +fi fix_cn_links echo -e "${WHITE}Fix broken symlinks ...${NOC}[${GRE}OK${NOC}]" ## do a short break