diff --git a/dns-api.sh b/dns-api.sh index 5cf612ff823c24db383be5bb20331bac7befa3f4..bef15ecf968e5b5afd60c1127f24f447c80ad606 100755 --- a/dns-api.sh +++ b/dns-api.sh @@ -27,8 +27,8 @@ # ----- read cli params method=GET -echo "$1" | grep -E "^(GET|PUT|POST|DELETE)$" >/dev/null -if [ $? -eq 0 ]; then +if echo "$1" | grep -E "^(GET|PUT|POST|DELETE)$" >/dev/null +then method=$1 shift 1 fi diff --git a/dns-search.sh b/dns-search.sh index dcfcec996534081d8137c03428660ef006d4d6a7..21a886954ddac46168dde1959d4c90af9685930e 100755 --- a/dns-search.sh +++ b/dns-search.sh @@ -6,6 +6,7 @@ # ---------------------------------------------------------------------- # 2021-10-29 v1.0 <axel.hahn@iml.unibe.ch> # 2022-01-14 v1.0 <axel.hahn@iml.unibe.ch> 1st public version +# 2022-03-01 v1.1 <axel.hahn@iml.unibe.ch> fix usage with 1st param "name" # ====================================================================== @@ -39,8 +40,8 @@ exit 0 fi mytype=name -echo "$1" | grep -E '^(host|alias)$' >/dev/null -if [ $? -eq 0 ]; then +if echo "$1" | grep -E '^(name|alias)$' >/dev/null +then mytype=$1 shift 1 fi