Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
0b539a59
Commit
0b539a59
authored
May 31, 2020
by
StefanAbl
Browse files
first attempt to make travis happy
parent
395fdc9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_dynv6.sh
View file @
0b539a59
...
@@ -14,17 +14,14 @@ dns_dynv6_add() {
...
@@ -14,17 +14,14 @@ dns_dynv6_add() {
_get_keyfile
_get_keyfile
_info
"using keyfile
$dynv6_keyfile
"
_info
"using keyfile
$dynv6_keyfile
"
_your_hosts
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
)
"
_your_hosts
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
)
"
<<<<<<
< HEAD
=======
>>>>>>>
first attempt to make travis happy
if
!
_get_domain
"
$fulldomain
"
"
$_your_hosts
"
;
then
if
!
_get_domain
"
$fulldomain
"
"
$_your_hosts
"
;
then
_err
"Host not found on your account"
_err
"Host not found on your account"
return
1
return
1
fi
fi
# if ! _contains "$_your_hosts" "$_host"; then
# _debug "The host is $_host and the record $_record"
# _debug "Dynv6 returned $_your_hosts"
# _err "The host $_host does not exists on your dynv6 account"
# return 1
# fi
_debug
"found host on your account"
_debug
"found host on your account"
returnval
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
\"
"
$_host
"
\"
records
set
\"
"
$_record
"
\"
txt data
\"
"
$txtvalue
"
\"
)
"
returnval
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
\"
"
$_host
"
\"
records
set
\"
"
$_record
"
\"
txt data
\"
"
$txtvalue
"
\"
)
"
_debug
"Dynv6 returend this after record was added:
$returnval
"
_debug
"Dynv6 returend this after record was added:
$returnval
"
...
@@ -50,19 +47,12 @@ dns_dynv6_rm() {
...
@@ -50,19 +47,12 @@ dns_dynv6_rm() {
_info
"using keyfile
$dynv6_keyfile
"
_info
"using keyfile
$dynv6_keyfile
"
_your_hosts
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
)
"
_your_hosts
=
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
)
"
if
!
_get_domain
"
$fulldomain
"
"
$_your_hosts
"
;
then
if
!
_get_domain
"
$fulldomain
"
"
$_your_hosts
"
;
then
_err
"Host not found on your account"
_err
"Host not found on your account"
return
1
return
1
fi
fi
# if ! _contains "$_your_hosts" "$_host"; then
# _debug "The host is $_host and the record $_record"
# _debug "Dynv6 returned $_your_hosts"
# _err "The host $_host does not exists on your dynv6 account"
# return 1
# fi
_debug
"found host on your account"
_debug
"found host on your account"
_info
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
"
\"
$_host
\"
"
records del
"
\"
$_record
\"
"
txt
)
"
_info
"
$(
ssh
-i
"
$dynv6_keyfile
"
api@dynv6.com hosts
"
\"
$_host
\"
"
records del
"
\"
$_record
\"
"
txt
)
"
return
0
return
0
}
}
#################### Private functions below ##################################
#################### Private functions below ##################################
#Usage: No Input required
#Usage: No Input required
...
@@ -93,13 +83,13 @@ _get_domain() {
...
@@ -93,13 +83,13 @@ _get_domain() {
_your_hosts
=
"
$(
echo
"
$_your_hosts
"
|
awk
'/\./ {print $1}'
)
"
_your_hosts
=
"
$(
echo
"
$_your_hosts
"
|
awk
'/\./ {print $1}'
)
"
for
l
in
$_your_hosts
;
do
for
l
in
$_your_hosts
;
do
#echo "host: $l"
#echo "host: $l"
if
test
"
${
_full_domain
#*
$l
}
"
!=
"
$_full_domain
"
;
then
if
test
"
${
_full_domain
#*
$l
}
"
!=
"
$_full_domain
"
;
then
_record
=
"
${
_full_domain
%.
$l
}
"
_record
=
"
${
_full_domain
%.
$l
}
"
_host
=
$l
_host
=
$l
_debug
"The host is
$_host
and the record
$_record
"
_debug
"The host is
$_host
and the record
$_record
"
return
0
return
0
fi
fi
done
done
_err
"Either their is no such host on your dnyv6 account or it cannot be accessed with this key"
_err
"Either their is no such host on your dnyv6 account or it cannot be accessed with this key"
return
1
return
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment