Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
978ec911
Commit
978ec911
authored
Mar 05, 2019
by
Miodrag Tokić
Browse files
Extract configuration loading code to function
parent
297859c5
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_loopia.sh
View file @
978ec911
...
...
@@ -14,13 +14,7 @@ dns_loopia_add() {
fulldomain
=
$1
txtvalue
=
$2
LOOPIA_User
=
"
${
LOOPIA_User
:-
$(
_readaccountconf_mutable LOOPIA_User
)
}
"
LOOPIA_Password
=
"
${
LOOPIA_Password
:-
$(
_readaccountconf_mutable LOOPIA_Password
)
}
"
if
[
-z
"
$LOOPIA_User
"
]
||
[
-z
"
$LOOPIA_Password
"
]
;
then
LOOPIA_User
=
""
LOOPIA_Password
=
""
_err
"You don't specify loopia user and password yet."
_err
"Please create you key and try again."
if
!
_loopia_load_config
;
then
return
1
fi
...
...
@@ -47,13 +41,7 @@ dns_loopia_rm() {
fulldomain
=
$1
txtvalue
=
$2
LOOPIA_User
=
"
${
LOOPIA_User
:-
$(
_readaccountconf_mutable LOOPIA_User
)
}
"
LOOPIA_Password
=
"
${
LOOPIA_Password
:-
$(
_readaccountconf_mutable LOOPIA_Password
)
}
"
if
[
-z
"
$LOOPIA_User
"
]
||
[
-z
"
$LOOPIA_Password
"
]
;
then
LOOPIA_User
=
""
LOOPIA_Password
=
""
_err
"You don't specify LOOPIA user and password yet."
_err
"Please create you key and try again."
if
!
_loopia_load_config
;
then
return
1
fi
...
...
@@ -96,6 +84,23 @@ dns_loopia_rm() {
#################### Private functions below ##################################
_loopia_load_config
()
{
LOOPIA_User
=
"
${
LOOPIA_User
:-
$(
_readaccountconf_mutable LOOPIA_User
)
}
"
LOOPIA_Password
=
"
${
LOOPIA_Password
:-
$(
_readaccountconf_mutable LOOPIA_Password
)
}
"
if
[
-z
"
$LOOPIA_User
"
]
||
[
-z
"
$LOOPIA_Password
"
]
;
then
LOOPIA_User
=
""
LOOPIA_Password
=
""
_err
"You don't specify loopia user and password yet."
_err
"Please create you key and try again."
return
1
fi
return
0
}
_loopia_get_records
()
{
domain
=
$1
sub_domain
=
$2
...
...
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