diff options
Diffstat (limited to 'scripts/chroot_scripts/cfunctions')
-rwxr-xr-x | scripts/chroot_scripts/cfunctions | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/scripts/chroot_scripts/cfunctions b/scripts/chroot_scripts/cfunctions index 1b9d500..7d9671d 100755 --- a/scripts/chroot_scripts/cfunctions +++ b/scripts/chroot_scripts/cfunctions @@ -330,13 +330,14 @@ _emerge_eix() { } _update_eix() { + #trap exit 1 SIGHUP SIGINT SIGTERM if eix-update >LAST_ACTION 2>&1; then _e_report_back "Update of eix was successful" _monitor_chroot_flow "UPDATE" - return 0 else echo "eix-update" > LAST_FAILED_COMMAND - ask_for_shell "Updating eix failed" + combat_medic + #ask_for_shell "Updating eix failed" fi } @@ -359,7 +360,7 @@ _portage_subpart() { if [[ -n $(echo "$@" | grep 'catalyst') ]]; then #emerge --sync >LAST_ACTION 2>&1 && pass || { echo "emerge --sync" > LAST_FAILED_COMMAND; combat_medic; } - fi rsync -aAXhrv root@192.168.2.2:/usr/portage/ /usr/portage/ >LAST_ACTION 2>&1; then + if rsync -aAXhrv root@192.168.2.2:/usr/portage/ /usr/portage/ >LAST_ACTION 2>&1; then pass else echo "rsync -aAXhrv root@192.168.2.2:/usr/portage/ /usr/portage/" > LAST_FAILED_COMMAND @@ -385,19 +386,11 @@ _portage_subpart() { echo -e "\e[34mEmerging eix\e[0m" _emerge_eix echo -e "\e[34mUpdating eix database\e[0m" - if _update_eix; then - _o_report_back "Updated" - else - combat_medic - fi + _update_eix else echo -e "\e[33meix located\e[0m" echo -e "\e[34mUpdating eix database\e[0m" - if _update_eix; then - _o_report_back "Updated" - else - combat_medic - fi + _update_eix fi if ! eix --installed app-portage/gentoolkit >LAST_ACTION 2>&1; then echo -e "\e[34mEmerging app-portage/gentoolkit\e[0m" @@ -557,7 +550,7 @@ _configure_fstab() { } _copy_function() { - if [[ -n $(cat "${CHDIR}/$1" | sed '/^#/ d' | sed '/^\s*$/d') ]] + if [[ -n $(cat "${CHDIR}/$1" | sed '/^#/ d' | sed '/^\s*$/d') ]]; then if cp "${CHDIR}/$1" /etc/conf.d/"$2"; then echo -e "[\e[32m*\e[0m] Configuring [\e[34m$3\e[0m]" else @@ -844,11 +837,12 @@ _resume(){ ask_for_shell() { while true; do _print_info 2 - echo "$@" - echo "Do you wish to call shell function and fix the issues manually?" - echo "An issues.info file will be created in the current directory" - echo "The above file will contain the instruction that gse attempted to execute" - echo "Answer Y/N " + _e_report_back "$*" + echo + _e_report_back "Do you wish to call shell function and fix the issues manually?" + _e_report_back "An issues.info file will be created in the current directory" + _e_report_back "The above file will contain the instruction that gse attempted to execute" + _e_report_back "Answer Y/N " read -rp "Input :: <= " YN case "$YN" in [yY]) @@ -934,13 +928,17 @@ combat_medic() { chroot_master_loop "LOOPEMERGE" } +_trao_sigs() { + ask_for_shell "External termination signal detected" +} + # SUBSHELL LOOP FUNCTION, IT OFFERS subshell_loop() { while true; do _subshell - echo "If you fixed the issue, say CONTINUE proceed" - echo "You can answer SHELL to open shell again, or call die with EXIT" - echo "Answer? CONTINUE/SHELL/EXIT: " + _e_report_back "If you fixed the issue, say CONTINUE proceed" + _e_report_back "You can answer SHELL to open shell again, or call die with EXIT" + _e_report_back "Answer? CONTINUE/SHELL/EXIT: " read -rp "Input :: <= " AANS case "${AANS}" in CONTINUE) @@ -1008,7 +1006,7 @@ _do_hs() { _call_hook_points() { if ! echo "$@" | grep -q '_flag_auto'; then if echo "${_lawful_args[@]}" | grep -q "$2"; then - _e_report_back "Lawful entry detected on $2, proceeding..." + _o_report_back "Lawful entry detected on $2, proceeding..." else if [[ "$(grep "$1" "${CHDIR}/chsinprog" | awk -F '=' '{ print $2 }')" == 0 || -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then if [[ -n "${_flag_force_new}" ]] || echo "${_enforce_args[@]}" | grep -q "$2"; then @@ -1026,6 +1024,10 @@ _call_hook_points() { fi fi else - eval "$4" "${@:5}" + if echo "${_lawful_args[@]}" | grep -q "$2"; then + _o_report_back "Lawful entry detected on $2, proceeding..." + else + eval "$4" "${@:5}" + fi fi }
\ No newline at end of file |