From c033f1eb5de2f9158fb08eb5c9d380a4aa04fa1c Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 May 2024 00:07:23 +0800 Subject: [PATCH] Update installation script to handle errors and exit with the appropriate status code --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index df57c01..369ffd4 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,7 @@ #!/usr/bin/env sh +set -e -o pipefail + #https://github.com/acmesh-official/get.acme.sh _exists() { @@ -45,10 +47,13 @@ exit 1 fi +$_get "$_url" | sh -s -- --install-online $_email "$@" +_ret=$? -if ! $_get "$_url" | sh -s -- --install-online $_email "$@"; then +if [ $_ret -ne 0 ]; then echo "Install error" echo "中国大陆用户请参考:" echo "https://github.com/acmesh-official/acme.sh/wiki/Install-in-China" fi +exit $_ret