fix shellcheck warnings.

This commit is contained in:
neilpang 2016-11-09 22:28:12 +08:00
parent e799ef2977
commit 201aa24448
1 changed files with 17 additions and 14 deletions

31
acme.sh
View File

@ -227,9 +227,9 @@ _getfield() {
_sep="," _sep=","
fi fi
_ffi=$_findex _ffi="$_findex"
while [ "$_ffi" -gt "0" ]; do while [ "$_ffi" -gt "0" ]; do
_fv="$(echo "$_str" | cut -d $_sep -f "$_ffi")" _fv="$(echo "$_str" | cut -d "$_sep" -f "$_ffi")"
if [ "$_fv" ]; then if [ "$_fv" ]; then
printf -- "%s" "$_fv" printf -- "%s" "$_fv"
return 0 return 0
@ -3006,12 +3006,14 @@ renewAll() {
_debug "_stopRenewOnError" "$_stopRenewOnError" _debug "_stopRenewOnError" "$_stopRenewOnError"
_ret="0" _ret="0"
for d in $(ls -F ${CERT_HOME}/ | grep [^.].*[.].*/$); do for d in "${CERT_HOME}"/*.*/; do
d=$(echo $d | cut -d '/' -f 1) _debug d "$d"
d=$(basename "$d")
_debug d "$d"
( (
if _endswith $d "$ECC_SUFFIX"; then if _endswith "$d" "$ECC_SUFFIX"; then
_isEcc=$(echo $d | cut -d "$ECC_SEP" -f 2) _isEcc=$(echo "$d" | cut -d "$ECC_SEP" -f 2)
d=$(echo $d | cut -d "$ECC_SEP" -f 1) d=$(echo "$d" | cut -d "$ECC_SEP" -f 1)
fi fi
renew "$d" "$_isEcc" renew "$d" "$_isEcc"
) )
@ -3022,14 +3024,14 @@ renewAll() {
_info "Skipped $d" _info "Skipped $d"
elif [ "$_stopRenewOnError" ]; then elif [ "$_stopRenewOnError" ]; then
_err "Error renew $d, stop now." _err "Error renew $d, stop now."
return $rc return "$rc"
else else
_ret="$rc" _ret="$rc"
_err "Error renew $d, Go ahead to next one." _err "Error renew $d, Go ahead to next one."
fi fi
fi fi
done done
return $_ret return "$_ret"
} }
#csr webroot #csr webroot
@ -3127,12 +3129,13 @@ list() {
_sep="|" _sep="|"
if [ "$_raw" ]; then if [ "$_raw" ]; then
printf "%s\n" "Main_Domain${_sep}KeyLength${_sep}SAN_Domains${_sep}Created${_sep}Renew" printf "%s\n" "Main_Domain${_sep}KeyLength${_sep}SAN_Domains${_sep}Created${_sep}Renew"
for d in $(ls -F ${CERT_HOME}/ | grep [^.].*[.].*/$); do for d in "${CERT_HOME}"/*.*/; do
d=$(echo $d | cut -d '/' -f 1) d=$(basename "$d")
_debug d "$d"
( (
if _endswith $d "$ECC_SUFFIX"; then if _endswith "$d" "$ECC_SUFFIX"; then
_isEcc=$(echo $d | cut -d "$ECC_SEP" -f 2) _isEcc=$(echo "$d" | cut -d "$ECC_SEP" -f 2)
d=$(echo $d | cut -d "$ECC_SEP" -f 1) d=$(echo "$d" | cut -d "$ECC_SEP" -f 1)
fi fi
_initpath $d "$_isEcc" _initpath $d "$_isEcc"
if [ -f "$DOMAIN_CONF" ]; then if [ -f "$DOMAIN_CONF" ]; then