World4You using ggrep in solaris

This commit is contained in:
Lorenz Stechauner 2020-11-27 19:34:16 +01:00
parent 64ae3280e1
commit bb3cc1130b

View File

@ -24,7 +24,7 @@ dns_world4you_add() {
fi fi
export _H1="Cookie: W4YSESSID=$sessid" export _H1="Cookie: W4YSESSID=$sessid"
paketnr=$(_get "$WORLD4YOU_API/dashboard/paketuebersicht" | grep -B 3 "^\\s*$tld\$" | head -n 1 | sed 's/^.*>\([0-9][0-9]*\)<.*$/\1/') paketnr=$(_get "$WORLD4YOU_API/dashboard/paketuebersicht" | _ggrep -B 3 "^\\s*$tld\$" | head -n 1 | sed 's/^.*>\([0-9][0-9]*\)<.*$/\1/')
if [ -z "$paketnr" ]; then if [ -z "$paketnr" ]; then
_err "Unable to parse paketnr" _err "Unable to parse paketnr"
return 3 return 3
@ -78,7 +78,7 @@ dns_world4you_rm() {
fi fi
export _H1="Cookie: W4YSESSID=$sessid" export _H1="Cookie: W4YSESSID=$sessid"
paketnr=$(_get "$WORLD4YOU_API/dashboard/paketuebersicht" | grep -B 3 "^\\s*$tld\$" | head -n 1 | sed 's/^.*>\([0-9][0-9]*\).*$/\1/') paketnr=$(_get "$WORLD4YOU_API/dashboard/paketuebersicht" | _ggrep -B 3 "^\\s*$tld\$" | head -n 1 | sed 's/^.*>\([0-9][0-9]*\).*$/\1/')
if [ -z "$paketnr" ]; then if [ -z "$paketnr" ]; then
_err "Unable to parse paketnr" _err "Unable to parse paketnr"
return 3 return 3
@ -157,3 +157,13 @@ _login() {
return 1 return 1
fi fi
} }
_ggrep() {
if _exists "ggrep"; then
ggrep $@
return $?
else
grep $@
return $?
fi
}