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
f9b8d7a9
Commit
f9b8d7a9
authored
Dec 08, 2017
by
Aarup
Browse files
renamed uno_user and uno_key
parent
f763e1ed
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_unoeuro.sh
View file @
f9b8d7a9
#!/usr/bin/env sh
#!/usr/bin/env sh
#
#
#U
no
_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
#U
NO
_Key="sdfsdfsdfljlbjkljlkjsdfoiwje"
#
#
#U
no
_User="UExxxxxx"
#U
NO
_User="UExxxxxx"
Uno_Api
=
"https://api.unoeuro.com/1"
Uno_Api
=
"https://api.unoeuro.com/1"
...
@@ -14,25 +14,25 @@ dns_unoeuro_add() {
...
@@ -14,25 +14,25 @@ dns_unoeuro_add() {
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
U
no
_Key
=
"
${
U
no
_Key
:-
$(
_readaccountconf_mutable U
no
_Key
)
}
"
U
NO
_Key
=
"
${
U
NO
_Key
:-
$(
_readaccountconf_mutable U
NO
_Key
)
}
"
U
no
_User
=
"
${
U
no
_User
:-
$(
_readaccountconf_mutable U
no
_User
)
}
"
U
NO
_User
=
"
${
U
NO
_User
:-
$(
_readaccountconf_mutable U
NO
_User
)
}
"
if
[
-z
"
$U
no
_Key
"
]
||
[
-z
"
$U
no
_User
"
]
;
then
if
[
-z
"
$U
NO
_Key
"
]
||
[
-z
"
$U
NO
_User
"
]
;
then
U
no
_Key
=
""
U
NO
_Key
=
""
U
no
_User
=
""
U
NO
_User
=
""
_err
"You haven't specified a UnoEuro api key and account yet."
_err
"You haven't specified a UnoEuro api key and account yet."
_err
"Please create your key and try again."
_err
"Please create your key and try again."
return
1
return
1
fi
fi
if
!
_contains
"
$U
no
_User
"
"UE"
;
then
if
!
_contains
"
$U
NO
_User
"
"UE"
;
then
_err
"It seems that the U
no
_User=
$U
no
_User
is not a valid username."
_err
"It seems that the U
NO
_User=
$U
NO
_User
is not a valid username."
_err
"Please check and retry."
_err
"Please check and retry."
return
1
return
1
fi
fi
#save the api key and email to the account conf file.
#save the api key and email to the account conf file.
_saveaccountconf_mutable U
no
_Key
"
$U
no
_Key
"
_saveaccountconf_mutable U
NO
_Key
"
$U
NO
_Key
"
_saveaccountconf_mutable U
no
_User
"
$U
no
_User
"
_saveaccountconf_mutable U
NO
_User
"
$U
NO
_User
"
_debug
"First detect the root zone"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
if
!
_get_root
"
$fulldomain
"
;
then
...
@@ -86,18 +86,18 @@ dns_unoeuro_rm() {
...
@@ -86,18 +86,18 @@ dns_unoeuro_rm() {
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
U
no
_Key
=
"
${
U
no
_Key
:-
$(
_readaccountconf_mutable U
no
_Key
)
}
"
U
NO
_Key
=
"
${
U
NO
_Key
:-
$(
_readaccountconf_mutable U
NO
_Key
)
}
"
U
no
_User
=
"
${
U
no
_User
:-
$(
_readaccountconf_mutable U
no
_User
)
}
"
U
NO
_User
=
"
${
U
NO
_User
:-
$(
_readaccountconf_mutable U
NO
_User
)
}
"
if
[
-z
"
$U
no
_Key
"
]
||
[
-z
"
$U
no
_User
"
]
;
then
if
[
-z
"
$U
NO
_Key
"
]
||
[
-z
"
$U
NO
_User
"
]
;
then
U
no
_Key
=
""
U
NO
_Key
=
""
U
no
_User
=
""
U
NO
_User
=
""
_err
"You haven't specified a UnoEuro api key and account yet."
_err
"You haven't specified a UnoEuro api key and account yet."
_err
"Please create your key and try again."
_err
"Please create your key and try again."
return
1
return
1
fi
fi
if
!
_contains
"
$U
no
_User
"
"UE"
;
then
if
!
_contains
"
$U
NO
_User
"
"UE"
;
then
_err
"It seems that the U
no
_User=
$U
no
_User
is not a valid username."
_err
"It seems that the U
NO
_User=
$U
NO
_User
is not a valid username."
_err
"Please check and retry."
_err
"Please check and retry."
return
1
return
1
fi
fi
...
@@ -188,9 +188,9 @@ _uno_rest() {
...
@@ -188,9 +188,9 @@ _uno_rest() {
if
[
"
$m
"
!=
"GET"
]
;
then
if
[
"
$m
"
!=
"GET"
]
;
then
_debug data
"
$data
"
_debug data
"
$data
"
response
=
"
$(
_post
"
$data
"
"
$Uno_Api
/
$U
no
_User
/
$U
no
_Key
/
$ep
"
""
"
$m
"
)
"
response
=
"
$(
_post
"
$data
"
"
$Uno_Api
/
$U
NO
_User
/
$U
NO
_Key
/
$ep
"
""
"
$m
"
)
"
else
else
response
=
"
$(
_get
"
$Uno_Api
/
$U
no
_User
/
$U
no
_Key
/
$ep
"
)
"
response
=
"
$(
_get
"
$Uno_Api
/
$U
NO
_User
/
$U
NO
_Key
/
$ep
"
)
"
fi
fi
if
[
"
$?
"
!=
"0"
]
;
then
if
[
"
$?
"
!=
"0"
]
;
then
...
...
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