diff --git a/misc/build.func b/misc/build.func index a4481f8..67c2a9a 100644 --- a/misc/build.func +++ b/misc/build.func @@ -1166,30 +1166,30 @@ EOF # fi # } -api_exit_script() { - exit_code=$? - if [ $exit_code -ne 0 ]; then - case $exit_code in - 100) post_update_to_api "failed" "100: Unexpected error in create_lxc.sh" ;; - 101) post_update_to_api "failed" "101: No network connection detected in create_lxc.sh" ;; - 200) post_update_to_api "failed" "200: LXC creation failed in create_lxc.sh" ;; - 201) post_update_to_api "failed" "201: Invalid Storage class in create_lxc.sh" ;; - 202) post_update_to_api "failed" "202: User aborted menu in create_lxc.sh" ;; - 203) post_update_to_api "failed" "203: CTID not set in create_lxc.sh" ;; - 204) post_update_to_api "failed" "204: PCT_OSTYPE not set in create_lxc.sh" ;; - 205) post_update_to_api "failed" "205: CTID cannot be less than 100 in create_lxc.sh" ;; - 206) post_update_to_api "failed" "206: CTID already in use in create_lxc.sh" ;; - 207) post_update_to_api "failed" "207: Template not found in create_lxc.sh" ;; - 208) post_update_to_api "failed" "208: Error downloading template in create_lxc.sh" ;; - 209) post_update_to_api "failed" "209: Container creation failed, but template is intact in create_lxc.sh" ;; - *) post_update_to_api "failed" "Unknown error, exit code: $exit_code in create_lxc.sh" ;; - esac - fi -} +# api_exit_script() { +# exit_code=$? +# if [ $exit_code -ne 0 ]; then +# case $exit_code in +# 100) post_update_to_api "failed" "100: Unexpected error in create_lxc.sh" ;; +# 101) post_update_to_api "failed" "101: No network connection detected in create_lxc.sh" ;; +# 200) post_update_to_api "failed" "200: LXC creation failed in create_lxc.sh" ;; +# 201) post_update_to_api "failed" "201: Invalid Storage class in create_lxc.sh" ;; +# 202) post_update_to_api "failed" "202: User aborted menu in create_lxc.sh" ;; +# 203) post_update_to_api "failed" "203: CTID not set in create_lxc.sh" ;; +# 204) post_update_to_api "failed" "204: PCT_OSTYPE not set in create_lxc.sh" ;; +# 205) post_update_to_api "failed" "205: CTID cannot be less than 100 in create_lxc.sh" ;; +# 206) post_update_to_api "failed" "206: CTID already in use in create_lxc.sh" ;; +# 207) post_update_to_api "failed" "207: Template not found in create_lxc.sh" ;; +# 208) post_update_to_api "failed" "208: Error downloading template in create_lxc.sh" ;; +# 209) post_update_to_api "failed" "209: Container creation failed, but template is intact in create_lxc.sh" ;; +# *) post_update_to_api "failed" "Unknown error, exit code: $exit_code in create_lxc.sh" ;; +# esac +# fi +# } -if command -v pveversion >/dev/null 2>&1; then - trap 'api_exit_script' EXIT -fi -trap 'post_update_to_api "failed" "$BASH_COMMAND"' ERR -trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT -trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM +# if command -v pveversion >/dev/null 2>&1; then +# trap 'api_exit_script' EXIT +# fi +# trap 'post_update_to_api "failed" "$BASH_COMMAND"' ERR +# trap 'post_update_to_api "failed" "INTERRUPTED"' SIGINT +# trap 'post_update_to_api "failed" "TERMINATED"' SIGTERM