|
@ -39,7 +39,7 @@ dns_nfs_rm() { |
|
|
#################### Private functions below ################################## |
|
|
#################### Private functions below ################################## |
|
|
# Usage add: _nfs_rest "/dns/domain.com/addRR" "name=" 'type=TXT' "data=KjiayTfXPHmnHmOdevsOtJyzsU9AHw2T6R0lNVCl_oi" |
|
|
# Usage add: _nfs_rest "/dns/domain.com/addRR" "name=" 'type=TXT' "data=KjiayTfXPHmnHmOdevsOtJyzsU9AHw2T6R0lNVCl_oi" |
|
|
# remove: _nfs_rest "/dns/domain.com/removeRR" "name=www" 'type=TXT' "data=KjiayTfXPHmnHmOdevsOtJyzsU9AHw2T6R0lNVCl_oi" |
|
|
# remove: _nfs_rest "/dns/domain.com/removeRR" "name=www" 'type=TXT' "data=KjiayTfXPHmnHmOdevsOtJyzsU9AHw2T6R0lNVCl_oi" |
|
|
_nfs_rest () { |
|
|
|
|
|
|
|
|
_nfs_rest() { |
|
|
|
|
|
|
|
|
# Make sure NFS_ACCOUNT is set else exit |
|
|
# Make sure NFS_ACCOUNT is set else exit |
|
|
if [ -z "$NFS_ACCOUNT" ]; then |
|
|
if [ -z "$NFS_ACCOUNT" ]; then |
|
@ -54,7 +54,7 @@ _nfs_rest () { |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
TIMESTAMP=$(date +%s) |
|
|
TIMESTAMP=$(date +%s) |
|
|
SALT=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 16) |
|
|
|
|
|
|
|
|
SALT=$(tr -dc 'a-zA-Z0-9' </dev/urandom | head -c 16) |
|
|
REQUEST_URI="$1" |
|
|
REQUEST_URI="$1" |
|
|
|
|
|
|
|
|
if [ "$#" -gt "1" ]; then |
|
|
if [ "$#" -gt "1" ]; then |
|
@ -62,8 +62,7 @@ _nfs_rest () { |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
COUNT=3 |
|
|
COUNT=3 |
|
|
while test $COUNT -le $# |
|
|
|
|
|
do |
|
|
|
|
|
|
|
|
while test $COUNT -le $#; do |
|
|
eval "PARAMETER=\$$COUNT" |
|
|
eval "PARAMETER=\$$COUNT" |
|
|
# shellcheck disable=SC2153 |
|
|
# shellcheck disable=SC2153 |
|
|
PARAMETERS="$PARAMETERS&$PARAMETER" |
|
|
PARAMETERS="$PARAMETERS&$PARAMETER" |
|
|