浏览代码

Update create_lxc.sh

add error message
tteckster 2 年之前
父节点
当前提交
67df410019
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      ct/create_lxc.sh

+ 4 - 1
ct/create_lxc.sh

@@ -22,7 +22,10 @@ function error_handler() {
   local line_number="$1"
   local line_number="$1"
   local command="$2"
   local command="$2"
   local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
   local error_message="${RD}[ERROR]${CL} in line ${RD}$line_number${CL}: exit code ${RD}$exit_code${CL}: while executing command ${YW}$command${CL}"
-  echo -e "\n$error_message\n"
+  echo -e "\n$error_message"
+  if [[ "$line_number" -eq 22 ]]; then
+    echo -e "The silent function has suppressed the error, run the script with verbose mode enabled, which will provide more detailed output.\n"
+  fi
 }
 }
 function msg_info() {
 function msg_info() {
   local msg="$1"
   local msg="$1"