Codacy compliant

This commit is contained in:
Samuel Huang
2024-09-30 23:05:53 +10:00
parent 8d2a35c53e
commit 3ae14cfa24
17 changed files with 78 additions and 48 deletions

8
run.sh
View File

@@ -41,7 +41,7 @@ usage() {
Jrules='{"rules":[]}' Jrules='{"rules":[]}'
TEMP=$(getopt -o "u:k:r:c:j:di" --long "lgp:,lgr:,lgt:,lsp:,lst:,ltr:,ltrx:,ltt:,lttx:,lwp:,lwt:,mtt:,mwp:,mwt:,ttt:,twp:,twt:,user:,hook:,request-domain:,cert-home:,ip-block:,domain-block:,cn-block,ng-server:,ng-proxy:,st-server:,st-map:,json:,stdin,debug" -n "$0" -- $@) TEMP=$(getopt -o u:k:r:c:j:di --long lgp:,lgr:,lgt:,lsp:,lst:,ltr:,ltrx:,ltt:,lttx:,lwp:,lwt:,mtt:,mwp:,mwt:,ttt:,twp:,twt:,user:,hook:,request-domain:,cert-home:,ip-block:,domain-block:,cn-block,ng-server:,ng-proxy:,st-server:,st-map:,json:,stdin,debug -n "$0" -- "$@")
if [ $? != 0 ] ; then usage; exit 1 ; fi if [ $? != 0 ] ; then usage; exit 1 ; fi
eval set -- "$TEMP" eval set -- "$TEMP"
@@ -148,7 +148,7 @@ if [ -n "${HOOKURL}" ]; then
fi fi
# Acquiring Letsencrypt certs for each request-domain # Acquiring Letsencrypt certs for each request-domain
if [ -n "${CERTDOMAIN}" ]; then if [ "${#CERTDOMAIN[@]}" -gt 0 ]; then
for DOMAIN in "${CERTDOMAIN[@]}" for DOMAIN in "${CERTDOMAIN[@]}"
do do
TRY=0 TRY=0
@@ -171,7 +171,7 @@ fi
xopt="certhome=$CERTHOME" xopt="certhome=$CERTHOME"
for uopt in "${UOPT[@]}"; do xopt="$xopt,$uopt"; done for uopt in "${UOPT[@]}"; do xopt="$xopt,$uopt"; done
if [ -z "${SVCMD}" ]; then if [ "${#SVCMD[@]}" -eq 0 ]; then
echo -e "No Xray service creation found. Quit.\n" echo -e "No Xray service creation found. Quit.\n"
usage; exit 1 usage; exit 1
fi fi
@@ -231,7 +231,7 @@ done
if [ -n "${DEBUG}" ]; then loglevel="debug"; else loglevel="warning"; fi if [ -n "${DEBUG}" ]; then loglevel="debug"; else loglevel="warning"; fi
Jroot=$(echo $Jroot| jq --arg loglevel "${loglevel}" '.log.loglevel |= $loglevel') Jroot=$(echo $Jroot| jq --arg loglevel "${loglevel}" '.log.loglevel |= $loglevel')
if [ -n "${INJECT[@]}" ]; then if [ "${#INJECT[@]}" -gt 0 ]; then
for JSON_IN in "${INJECT[@]}" for JSON_IN in "${INJECT[@]}"
do do
Jmerge=$(jq -nc "${JSON_IN}") Jmerge=$(jq -nc "${JSON_IN}")

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|domain) d|domain)
domain="${kv[1]}" domain="${kv[1]}"
@@ -18,6 +18,9 @@ do
f|fallback) f|fallback)
fallback+=("${kv[1]}") fallback+=("${kv[1]}")
;; ;;
flow)
flow="${kv[1]}"
;;
p|port) p|port)
port="${kv[1]}" port="${kv[1]}"
;; ;;
@@ -32,6 +35,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${domain}" ]; then if [ -z "${domain}" ]; then
>&2 echo -e "Error: Domain undefined.\n" >&2 echo -e "Error: Domain undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|dest) d|dest)
dest="${kv[1]}" dest="${kv[1]}"
@@ -50,6 +50,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${dest}" ]; then if [ -z "${dest}" ]; then
>&2 echo -e "Error: Fake Destination undefined.\n" >&2 echo -e "Error: Fake Destination undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -41,6 +41,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|domain) d|domain)
domain="${kv[1]}" domain="${kv[1]}"
@@ -18,6 +18,9 @@ do
f|fallback) f|fallback)
fallback+=("${kv[1]}") fallback+=("${kv[1]}")
;; ;;
flow)
flow="${kv[1]}"
;;
p|port) p|port)
port="${kv[1]}" port="${kv[1]}"
;; ;;
@@ -32,6 +35,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${domain}" ]; then if [ -z "${domain}" ]; then
>&2 echo -e "Error: Domain undefined.\n" >&2 echo -e "Error: Domain undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -41,6 +41,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|dest) d|dest)
dest="${kv[1]}" dest="${kv[1]}"
@@ -47,6 +47,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${dest}" ]; then if [ -z "${dest}" ]; then
>&2 echo -e "Error: Fake Destination undefined.\n" >&2 echo -e "Error: Fake Destination undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -38,6 +38,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|domain) d|domain)
domain="${kv[1]}" domain="${kv[1]}"
@@ -18,6 +18,9 @@ do
f|fallback) f|fallback)
fallback+=("${kv[1]}") fallback+=("${kv[1]}")
;; ;;
flow)
flow="${kv[1]}"
;;
p|port) p|port)
port="${kv[1]}" port="${kv[1]}"
;; ;;
@@ -32,6 +35,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${domain}" ]; then if [ -z "${domain}" ]; then
>&2 echo -e "Error: Domain undefined.\n" >&2 echo -e "Error: Domain undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -41,6 +41,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -38,6 +38,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|domain) d|domain)
domain="${kv[1]}" domain="${kv[1]}"
@@ -18,6 +18,9 @@ do
f|fallback) f|fallback)
fallback+=("${kv[1]}") fallback+=("${kv[1]}")
;; ;;
flow)
flow="${kv[1]}"
;;
p|port) p|port)
port="${kv[1]}" port="${kv[1]}"
;; ;;
@@ -32,6 +35,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${domain}" ]; then if [ -z "${domain}" ]; then
>&2 echo -e "Error: Domain undefined.\n" >&2 echo -e "Error: Domain undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -41,6 +41,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -12,7 +12,7 @@ usage() {
>&2 echo " --st-server [p=443],[proxy_pass]" >&2 echo " --st-server [p=443],[proxy_pass]"
} }
TEMP=$(getopt -o "m:n:p:s:x:" --long "ng-server:,ng-proxy:,st-server:,st-map:" -n "$0" -- $@) TEMP=$(getopt -o m:n:p:s:x: --long ng-server:,ng-proxy:,st-server:,st-map: -n "$0" -- "$@")
if [ $? != 0 ] ; then usage; exit 1 ; fi if [ $? != 0 ] ; then usage; exit 1 ; fi
eval set -- "$TEMP" eval set -- "$TEMP"
@@ -49,13 +49,13 @@ while true ; do
esac esac
done done
if [ -z "${NGSVR}" ] && [ -z "${STPORT}" ]; then if [ "${#NGSVR[@]}" -eq 0 ] && [ -z "${STSVR}" ]; then
>&2 echo -e "No Stream/Server defined. Quit.\n"; >&2 echo -e "No Stream/Server defined. Quit.\n";
usage; exit 1; usage; exit 1;
fi fi
# Running as root to enable transparent stream. # Running as root to enable transparent stream.
# sed -i 's/^user \+nginx;$/user root;/g' /etc/nginx/nginx.conf # sed -i 's/^user \+nginx;$/user root;/g' $NGCONF
cd /etc/nginx/conf.d/ cd /etc/nginx/conf.d/
if [ -f /etc/nginx/conf.d/default.conf ]; then if [ -f /etc/nginx/conf.d/default.conf ]; then
@@ -63,9 +63,9 @@ if [ -f /etc/nginx/conf.d/default.conf ]; then
fi fi
# Remove all lines generated previously after #STREAM_TAG tag. # Remove all lines generated previously after #STREAM_TAG tag.
sed -i '/\#STREAM_TAG/q' /etc/nginx/nginx.conf sed -i '/\#STREAM_TAG/q' $NGCONF
# Remove #STREAM_TAG tag # Remove #STREAM_TAG tag
sed -i '/\#STREAM_TAG/d' /etc/nginx/nginx.conf sed -i '/\#STREAM_TAG/d' $NGCONF
# Generate Nginx Stream server configuration. # Generate Nginx Stream server configuration.
if [ -n "${STSVR}" ]; then if [ -n "${STSVR}" ]; then
@@ -87,7 +87,7 @@ options=($(echo $STSVR |tr ',' ' '))
if ! [ "${STPORT}" -eq "${STPORT}" ] 2>/dev/null; then >&2 echo "Stream port number must be numeric"; exit 1; fi if ! [ "${STPORT}" -eq "${STPORT}" ] 2>/dev/null; then >&2 echo "Stream port number must be numeric"; exit 1; fi
# Attaching the stream configuration template to the tail of nginx.conf # Attaching the stream configuration template to the tail of nginx.conf
cat ${STREAM_TPL} >> /etc/nginx/nginx.conf cat ${STREAM_TPL} >> $NGCONF
for stmap in "${STMAP[@]}" for stmap in "${STMAP[@]}"
do do
options=($(echo $stmap |tr ',' ' ')) options=($(echo $stmap |tr ',' ' '))
@@ -112,18 +112,18 @@ options=($(echo $STSVR |tr ',' ' '))
done done
# Adding map.conf down to #XMAP_TAG tag # Adding map.conf down to #XMAP_TAG tag
sed -i '/#XMAP_TAG/r /tmp/stmap.conf' /etc/nginx/nginx.conf sed -i '/#XMAP_TAG/r /tmp/stmap.conf' $NGCONF
# Adding ups.conf down to #XUPSTREAM_TAG tag # Adding ups.conf down to #XUPSTREAM_TAG tag
sed -i '/#XUPSTREAM_TAG/r /tmp/stups.conf' /etc/nginx/nginx.conf sed -i '/#XUPSTREAM_TAG/r /tmp/stups.conf' $NGCONF
sed -i "s/STPORT/${STPORT}/g" /etc/nginx/nginx.conf sed -i "s/STPORT/${STPORT}/g" $NGCONF
# Adding "proxy_protocol=on" down to #STPROXY_PASS_TAG tag # Adding "proxy_protocol=on" down to #STPROXY_PASS_TAG tag
if [ -n "${STPROXY_PASS}" ]; then if [ -n "${STPROXY_PASS}" ]; then
echo " proxy_protocol on;" >/tmp/stproxy.conf echo " proxy_protocol on;" >/tmp/stproxy.conf
sed -i '/#STPROXY_PASS_TAG/r /tmp/stproxy.conf' /etc/nginx/nginx.conf sed -i '/#STPROXY_PASS_TAG/r /tmp/stproxy.conf' $NGCONF
fi fi
rm -rf /tmp/stmap.conf; rm -rf /tmp/stups.conf; rm -rf /tmp/stproxy.conf rm -rf /tmp/stmap.conf; rm -rf /tmp/stups.conf; rm -rf /tmp/stproxy.conf
echo "Generated /etc/nginx/nginx.conf ====>" echo "Generated $NGCONF ====>"
cat /etc/nginx/nginx.conf cat $NGCONF
fi fi
# Generating Nginx site server configurations. # Generating Nginx site server configurations.
@@ -155,7 +155,7 @@ do
done done
if [ -z "${certhome}" ]; then echo -e "Error: Nginx certhome undefined.\n"; usage; exit 1; fi if [ -z "${certhome}" ]; then echo -e "Error: Nginx certhome undefined.\n"; usage; exit 1; fi
if [ -z "${SITEDOMAINS}" ]; then echo -e "Error: Nginx site domain undefined.\n"; usage; exit 1; fi if [ "${#SITEDOMAINS[@]}" -eq 0 ]; then echo -e "Error: Nginx site domain undefined.\n"; usage; exit 1; fi
if [ -z "${port}" ]; then port=443; fi if [ -z "${port}" ]; then port=443; fi
if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Port number must be numeric. \n"; exit 1; fi if ! [ "${port}" -eq "${port}" ] 2>/dev/null; then >&2 echo -e "Port number must be numeric. \n"; exit 1; fi
@@ -223,7 +223,7 @@ do
done done
if [ -z "${xhost}" ]; then xhost="127.0.0.1"; fi if [ -z "${xhost}" ]; then xhost="127.0.0.1"; fi
if [ -z "${XDOMAINS}" ]; then XDOMAINS=("${ALLDOMAINS[@]}"); fi if [ "${#XDOMAINS[@]}" -eq 0 ]; then XDOMAINS=("${ALLDOMAINS[@]}"); fi
if [ -z "${xnetwork}" ]; then echo "Missing network: $ngproxy"; usage; exit 1; fi if [ -z "${xnetwork}" ]; then echo "Missing network: $ngproxy"; usage; exit 1; fi
if [ -z "${xlocation}" ]; then echo "Missing location: $ngproxy"; usage; exit 1; fi if [ -z "${xlocation}" ]; then echo "Missing location: $ngproxy"; usage; exit 1; fi
if [ -z "${xport}" ]; then echo "Missing port: $ngproxy"; usage; exit 1; fi if [ -z "${xport}" ]; then echo "Missing port: $ngproxy"; usage; exit 1; fi

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user|u=<uid>[:level:email]" >&2 echo -e "User format: user|u=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -38,6 +38,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user=<uid>[:level:email]" >&2 echo -e "User format: user=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
d|domain) d|domain)
domain="${kv[1]}" domain="${kv[1]}"
@@ -18,6 +18,9 @@ do
f|fallback) f|fallback)
fallback+=("${kv[1]}") fallback+=("${kv[1]}")
;; ;;
flow)
flow="${kv[1]}"
;;
p|port) p|port)
port="${kv[1]}" port="${kv[1]}"
;; ;;
@@ -32,6 +35,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${domain}" ]; then if [ -z "${domain}" ]; then
>&2 echo -e "Error: Domain undefined.\n" >&2 echo -e "Error: Domain undefined.\n"

View File

@@ -7,10 +7,10 @@ usage() {
>&2 echo -e "User format: user=<uid>[:level:email]" >&2 echo -e "User format: user=<uid>[:level:email]"
} }
options=($(echo $1 |tr ',' ' ')) IFS=',' read -a options <<< "$1"
for option in "${options[@]}" for option in "${options[@]}"
do do
kv=($(echo $option |tr '=' ' ')) IFS='=' read -a kv <<< "$option"
case "${kv[0]}" in case "${kv[0]}" in
c|certhome) c|certhome)
certhome="${kv[1]}" certhome="${kv[1]}"
@@ -41,6 +41,7 @@ do
;; ;;
esac esac
done done
unset IFS
if [ -z "${certhome}" ]; then if [ -z "${certhome}" ]; then
>&2 echo -e "Error: Certhome undefined.\n" >&2 echo -e "Error: Certhome undefined.\n"