mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-11-20 05:11:43 +00:00
World4You posix shell
This commit is contained in:
parent
abe05456f7
commit
ef9147512b
@ -168,18 +168,19 @@ _get_paketnr() {
|
|||||||
tld="$1"
|
tld="$1"
|
||||||
form="$2"
|
form="$2"
|
||||||
|
|
||||||
domains=($(echo "$form" | _ggrep -E '^\s*([A-Za-z0-9_-]+\.)+[A-Za-z0-9_-]*$' | sed 's/^\s*\(\S*\)$/\1/'))
|
domains=$(echo "$form" | _ggrep -E '^\s*([A-Za-z0-9_-]+\.)+[A-Za-z0-9_-]*$' | sed 's/^\s*\(\S*\)$/\1/')
|
||||||
paketnrs=($(echo "$form" | _ggrep -B 3 -E '^\s*([A-Za-z0-9_-]+\.)+[A-Za-z0-9_-]*$' | sed -n '1~5p' | sed 's/^.*>\([0-9][0-9]*\).*$/\1/'))
|
domain=''
|
||||||
|
for domain in $domains; do
|
||||||
total="${#domains[*]}"
|
|
||||||
for (( i=0; i<=$(( $total - 1 )); i++ )); do
|
|
||||||
domain="${domains[$i]}"
|
|
||||||
if [ $(echo "$domain" | grep "$tld\$") ]; then
|
if [ $(echo "$domain" | grep "$tld\$") ]; then
|
||||||
PAKETNR="${paketnrs[$i]}"
|
break
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
if [ -z "$domain" ]; then
|
||||||
return 1
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PAKETNR=$(echo "$form" | _ggrep -B 3 "^\\s*$domain\$" | head -n 1 | sed 's/^.*>\([0-9][0-9]*\).*$/\1/')
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
_ggrep() {
|
_ggrep() {
|
||||||
|
Loading…
Reference in New Issue
Block a user