Browse Source
Formatting
using shfmt to format the code
pull/6504/head
An | Anton Röhm
1 month ago
committed by
An
No known key found for this signature in database
GPG Key ID: 27B2720845AC72FE
1 changed files with
10 additions and
10 deletions
-
dnsapi/dns_nanelo.sh
|
|
@ -90,21 +90,21 @@ _get_root() { |
|
|
|
response="$(_get "$NANELO_API$NANELO_TOKEN/dns/getzones")" || return 1 |
|
|
|
|
|
|
|
# Extract "zones" array into space-separated list |
|
|
|
zones=$(echo "$response" \ |
|
|
|
| tr -d ' \n' \ |
|
|
|
| sed -n 's/.*"zones":\[\([^]]*\)\].*/\1/p' \ |
|
|
|
| tr -d '"' \ |
|
|
|
| tr , ' ') |
|
|
|
zones=$(echo "$response" | |
|
|
|
tr -d ' \n' | |
|
|
|
sed -n 's/.*"zones":\[\([^]]*\)\].*/\1/p' | |
|
|
|
tr -d '"' | |
|
|
|
tr , ' ') |
|
|
|
_debug zones "$zones" |
|
|
|
|
|
|
|
bestzone="" |
|
|
|
for z in $zones; do |
|
|
|
case "$fulldomain" in |
|
|
|
*."$z"|"$z") |
|
|
|
if [ ${#z} -gt ${#bestzone} ]; then |
|
|
|
bestzone=$z |
|
|
|
fi |
|
|
|
;; |
|
|
|
*."$z" | "$z") |
|
|
|
if [ ${#z} -gt ${#bestzone} ]; then |
|
|
|
bestzone=$z |
|
|
|
fi |
|
|
|
;; |
|
|
|
esac |
|
|
|
done |
|
|
|
|
|
|
|