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
12593410
Unverified
Commit
12593410
authored
Feb 09, 2020
by
Brian Hartvigsen
Browse files
Use deployconf properly
parent
5d3bc95a
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/synology_dsm.sh
View file @
12593410
...
@@ -35,9 +35,9 @@ synology_dsm_deploy() {
...
@@ -35,9 +35,9 @@ synology_dsm_deploy() {
_debug _cdomain
"
$_cdomain
"
_debug _cdomain
"
$_cdomain
"
# Get Username and Password, but don't save until we successfully authenticate
# Get Username and Password, but don't save until we successfully authenticate
SYNO_Username
=
"
${
SYNO_Username
:-
$(
_getdeployconf SYNO_Username
)
}
"
_getdeployconf SYNO_Username
SYNO_Password
=
"
${
SYNO_Password
:-
$(
_getdeployconf SYNO_Password
)
}
"
_getdeployconf SYNO_Password
SYNO_Create
=
"
${
SYNO_Create
:-
$(
_getdeployconf SYNO_Create
)
}
"
_getdeployconf SYNO_Create
if
[
-z
"
$SYNO_Username
"
]
||
[
-z
"
$SYNO_Password
"
]
;
then
if
[
-z
"
$SYNO_Username
"
]
||
[
-z
"
$SYNO_Password
"
]
;
then
SYNO_Username
=
""
SYNO_Username
=
""
SYNO_Password
=
""
SYNO_Password
=
""
...
@@ -48,12 +48,9 @@ synology_dsm_deploy() {
...
@@ -48,12 +48,9 @@ synology_dsm_deploy() {
_secure_debug2 SYNO_Password
"
$SYNO_Password
"
_secure_debug2 SYNO_Password
"
$SYNO_Password
"
# Optional scheme, hostname, and port for Synology DSM
# Optional scheme, hostname, and port for Synology DSM
SYNO_Scheme
=
"
${
SYNO_Scheme
:-
$(
_getdeployconf SYNO_Scheme
)
}
"
_getdeployconf SYNO_Scheme
SYNO_Hostname
=
"
${
SYNO_Hostname
:-
$(
_getdeployconf SYNO_Hostname
)
}
"
_getdeployconf SYNO_Hostname
SYNO_Port
=
"
${
SYNO_Port
:-
$(
_getdeployconf SYNO_Port
)
}
"
_getdeployconf SYNO_Port
_savedeployconf SYNO_Scheme
"
$SYNO_Scheme
"
_savedeployconf SYNO_Hostname
"
$SYNO_Hostname
"
_savedeployconf SYNO_Port
"
$SYNO_Port
"
# default vaules for scheme, hostname, and port
# default vaules for scheme, hostname, and port
# defaulting to localhost and http because it's localhost...
# defaulting to localhost and http because it's localhost...
...
@@ -61,6 +58,10 @@ synology_dsm_deploy() {
...
@@ -61,6 +58,10 @@ synology_dsm_deploy() {
[
-n
"
${
SYNO_Hostname
}
"
]
||
SYNO_Hostname
=
"localhost"
[
-n
"
${
SYNO_Hostname
}
"
]
||
SYNO_Hostname
=
"localhost"
[
-n
"
${
SYNO_Port
}
"
]
||
SYNO_Port
=
"5000"
[
-n
"
${
SYNO_Port
}
"
]
||
SYNO_Port
=
"5000"
_savedeployconf SYNO_Scheme
"
$SYNO_Scheme
"
_savedeployconf SYNO_Hostname
"
$SYNO_Hostname
"
_savedeployconf SYNO_Port
"
$SYNO_Port
"
_debug2 SYNO_Scheme
"
$SYNO_Scheme
"
_debug2 SYNO_Scheme
"
$SYNO_Scheme
"
_debug2 SYNO_Hostname
"
$SYNO_Hostname
"
_debug2 SYNO_Hostname
"
$SYNO_Hostname
"
_debug2 SYNO_Port
"
$SYNO_Port
"
_debug2 SYNO_Port
"
$SYNO_Port
"
...
@@ -107,6 +108,7 @@ synology_dsm_deploy() {
...
@@ -107,6 +108,7 @@ synology_dsm_deploy() {
id
=
$(
echo
"
$response
"
|
sed
-n
"s/.*
\"
desc
\"
:
\"
$SYNO_Certificate
\"
,
\"
id
\"
:
\"\(
[^
\"
]*
\)
.*/
\1
/p"
)
id
=
$(
echo
"
$response
"
|
sed
-n
"s/.*
\"
desc
\"
:
\"
$SYNO_Certificate
\"
,
\"
id
\"
:
\"\(
[^
\"
]*
\)
.*/
\1
/p"
)
_debug2
id
"
$id
"
_debug2
id
"
$id
"
# shellcheck disable=SC2154
if
[
-z
"
$id
"
]
&&
[
-z
"
$SYNO_Create
"
]
;
then
if
[
-z
"
$id
"
]
&&
[
-z
"
$SYNO_Create
"
]
;
then
_err
"Unable to find certificate:
$SYNO_Certificate
and
\$
SYNO_Create is not set"
_err
"Unable to find certificate:
$SYNO_Certificate
and
\$
SYNO_Create is not set"
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