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
82b11da4
Unverified
Commit
82b11da4
authored
Jan 12, 2019
by
shonenada
Browse files
replace `awk` with `sed` and `tr`
parent
4ec39ab7
Changes
1
Show whitespace changes
Inline
Side-by-side
deploy/qiniu.sh
View file @
82b11da4
...
@@ -42,8 +42,8 @@ qiniu_deploy() {
...
@@ -42,8 +42,8 @@ qiniu_deploy() {
fi
fi
## upload certificate
## upload certificate
string_fullchain
=
$(
awk
'{printf "%s\\n", $0}
'
"
$_cfullchain
"
)
string_fullchain
=
$(
sed
's/$/\\n/
'
"
$_cfullchain
"
|
tr
-d
'\n'
)
string_key
=
$(
awk
'{printf "%s\\n", $0}'
"
$_ckey
"
)
string_key
=
$(
sed
's/$/\\n/'
"
$_ckey
"
|
tr
-d
'\n'
)
sslcert_path
=
"/sslcert"
sslcert_path
=
"/sslcert"
sslcerl_body
=
"{
\"
name
\"
:
\"
$_cdomain
\"
,
\"
common_name
\"
:
\"
$_cdomain
\"
,
\"
ca
\"
:
\"
$string_fullchain
\"
,
\"
pri
\"
:
\"
$string_key
\"
}"
sslcerl_body
=
"{
\"
name
\"
:
\"
$_cdomain
\"
,
\"
common_name
\"
:
\"
$_cdomain
\"
,
\"
ca
\"
:
\"
$string_fullchain
\"
,
\"
pri
\"
:
\"
$string_key
\"
}"
...
@@ -63,12 +63,12 @@ qiniu_deploy() {
...
@@ -63,12 +63,12 @@ qiniu_deploy() {
_info
"Certificate successfully uploaded, updating domain
$_cdomain
"
_info
"Certificate successfully uploaded, updating domain
$_cdomain
"
## extract certId
## extract certId
_certId
=
$(
printf
"%s"
"
$sslcert_response
"
|
sed
-e
"s/^.*certID
\"
:
\"
//"
-e
"s/
\"\}
$/
/"
)
_certId
=
"
$(
printf
"%s"
"
$sslcert_response
"
|
_normalizeJson | _egrep_o
"certID
\"
:
\s
*
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2
)
"
_debug certId
"
$_certId
"
_debug certId
"
$_certId
"
## update domain ssl config
## update domain ssl config
update_path
=
"/domain/
$_cdomain
/httpsconf"
update_path
=
"/domain/
$_cdomain
/httpsconf"
update_body
=
"{
\"
certid
\"
:
\"
$_certId
\"
,
\"
forceHttps
\"
:true}"
update_body
=
"{
\"
certid
\"
:
$_certId
,
\"
forceHttps
\"
:true}"
update_access_token
=
"
$(
_make_sslcreate_access_token
"
$update_path
"
)
"
update_access_token
=
"
$(
_make_sslcreate_access_token
"
$update_path
"
)
"
_debug update_access_token
"
$update_access_token
"
_debug update_access_token
"
$update_access_token
"
export
_H1
=
"Authorization: QBox
$update_access_token
"
export
_H1
=
"Authorization: QBox
$update_access_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