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
5957786b
Unverified
Commit
5957786b
authored
Jul 27, 2020
by
neil
Committed by
GitHub
Jul 27, 2020
Browse files
Merge pull request #3072 from tresni/synology_dsm
Support for DS218+
parents
41435578
5f5096e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/synology_dsm.sh
View file @
5957786b
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
######## Public functions #####################
######## Public functions #####################
_syno_get_cookie_data
()
{
_syno_get_cookie_data
()
{
grep
"
\W
$1
="
|
grep
"^Set-Cookie:"
| _tail_n 1 | _egrep_o
"
$1
=[^;]*;"
|
tr
-d
';'
grep
-i
"
\W
$1
="
|
grep
-i
"^Set-Cookie:"
| _tail_n 1 | _egrep_o
"
$1
=[^;]*;"
|
tr
-d
';'
}
}
#domain keyfile certfile cafile fullchain
#domain keyfile certfile cafile fullchain
...
@@ -79,7 +79,7 @@ synology_dsm_deploy() {
...
@@ -79,7 +79,7 @@ synology_dsm_deploy() {
encoded_password
=
"
$(
printf
"%s"
"
$SYNO_Password
"
| _url_encode
)
"
encoded_password
=
"
$(
printf
"%s"
"
$SYNO_Password
"
| _url_encode
)
"
encoded_did
=
"
$(
printf
"%s"
"
$SYNO_DID
"
| _url_encode
)
"
encoded_did
=
"
$(
printf
"%s"
"
$SYNO_DID
"
| _url_encode
)
"
response
=
$(
_get
"
$_base_url
/webman/login.cgi?username=
$encoded_username
&passwd=
$encoded_password
&enable_syno_token=yes&device_id=
$encoded_did
"
1
)
response
=
$(
_get
"
$_base_url
/webman/login.cgi?username=
$encoded_username
&passwd=
$encoded_password
&enable_syno_token=yes&device_id=
$encoded_did
"
1
)
token
=
$(
echo
"
$response
"
|
grep
"X-SYNO-TOKEN:"
|
sed
-n
's/^X-SYNO-TOKEN: \(.*\)$/\1/p'
|
tr
-d
"
\r\n
"
)
token
=
$(
echo
"
$response
"
|
grep
-i
"X-SYNO-TOKEN:"
|
sed
-n
's/^X-SYNO-TOKEN: \(.*\)$/\1/p
I
'
|
tr
-d
"
\r\n
"
)
_debug3 response
"
$response
"
_debug3 response
"
$response
"
_debug token
"
$token
"
_debug token
"
$token
"
...
...
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