Update build.func
This commit is contained in:
parent
59b6fc8836
commit
647de8fa43
@ -402,11 +402,11 @@ echo_default() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
||||||
#exit_script() {
|
exit_script() {
|
||||||
# clear
|
clear
|
||||||
# echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
||||||
# exit
|
exit
|
||||||
#}
|
}
|
||||||
|
|
||||||
# This function allows the user to configure advanced settings for the script.
|
# This function allows the user to configure advanced settings for the script.
|
||||||
advanced_settings() {
|
advanced_settings() {
|
||||||
@ -1455,12 +1455,10 @@ silent() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_script() {
|
api_exit_script() {
|
||||||
exit_code=$? # Capture the exit status of the last executed command
|
exit_code=$? # Capture the exit status of the last executed command
|
||||||
#200 exit codes indicate error in create_lxc.sh
|
#200 exit codes indicate error in create_lxc.sh
|
||||||
#100 exit codes indicate error in install.func
|
#100 exit codes indicate error in install.func
|
||||||
clear
|
|
||||||
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
|
||||||
|
|
||||||
if [ $exit_code -ne 0 ]; then
|
if [ $exit_code -ne 0 ]; then
|
||||||
case $exit_code in
|
case $exit_code in
|
||||||
@ -1482,7 +1480,7 @@ exit_script() {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
trap 'exit_script' EXIT
|
trap 'api_exit_script' EXIT
|
||||||
trap 'post_update_to_api "failed" "$BASH_COMMAND"' ERR
|
trap 'post_update_to_api "failed" "$BASH_COMMAND"' ERR
|
||||||
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT
|
||||||
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM
|
||||||
|
Loading…
x
Reference in New Issue
Block a user