소스 검색

Update pihole-install.sh

tteckster 3 년 전
부모
커밋
c13119da7b
1개의 변경된 파일17개의 추가작업 그리고 1개의 파일을 삭제
  1. 17 1
      setup/pihole-install.sh

+ 17 - 1
setup/pihole-install.sh

@@ -11,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"
@@ -38,7 +54,7 @@ done
 msg_ok "Set up Container OS"
 msg_ok "Network Connected: ${BL}$(hostname -I)"
 
-wget -q --tries=10 --timeout=5 --spider http://google.com
+wget -q --tries=10 --timeout=5 --spider https://google.com
 if [[ $? -eq 0 ]]; then
         msg_ok "Internet Online"
 else