mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-06 15:03:08 +00:00
quickfix exit_script
This commit is contained in:
parent
76e1e97681
commit
f47c8c0094
@ -385,6 +385,13 @@ echo_default() {
|
|||||||
echo -e " "
|
echo -e " "
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# This function is called when the user decides to exit the script. It clears the screen and displays an exit message.
|
||||||
|
exit_script() {
|
||||||
|
clear
|
||||||
|
echo -e "\n${CROSS}${RD}User exited script${CL}\n"
|
||||||
|
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() {
|
||||||
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Here is an instructional tip:" "To make a selection, use the Spacebar." 8 58
|
whiptail --backtitle "Proxmox VE Helper Scripts" --msgbox --title "Here is an instructional tip:" "To make a selection, use the Spacebar." 8 58
|
||||||
@ -1434,12 +1441,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
|
||||||
@ -1458,10 +1463,9 @@ exit_script() {
|
|||||||
*) post_update_to_api "failed" "Unknown error, exit code: $exit_code in create_lxc.sh" ;;
|
*) post_update_to_api "failed" "Unknown error, exit code: $exit_code in create_lxc.sh" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
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