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
a577c721
Commit
a577c721
authored
Jul 10, 2017
by
Santeri
Committed by
GitHub
Jul 10, 2017
Browse files
One more change to pass the check shellcheck test
Now it is tested and works also when run as a root.
parent
79664715
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/cpanel.sh
View file @
a577c721
#!/usr/bin/env sh
#!/usr/bin/env sh
# Here is the script to deploy the cert to your cpanel using the cpanel API.
# Here is the script to deploy the cert to your cpanel using the cpanel API.
# Uses command line uapi.
# Uses command line uapi. --user option is needed only if run as root.
# Cpanel username is needed only when run as root (I did not test this).
# Returns 0 when success.
# Returns 0 when success.
# Written by Santeri Kannisto <santeri.kannisto@2globalnomads.info>
# Written by Santeri Kannisto <santeri.kannisto@2globalnomads.info>
# Public domain, 2017
# Public domain, 2017
...
@@ -35,12 +34,11 @@ cpanel_deploy() {
...
@@ -35,12 +34,11 @@ cpanel_deploy() {
_debug _key
"
$_key
"
_debug _key
"
$_key
"
if
[
"
$(
id
-u
)
"
=
0
]
;
then
if
[
"
$(
id
-u
)
"
=
0
]
;
then
_opt
=
"--user=
$DEPLOY_CPANEL_USER
"
_response
=
$(
uapi
--user
=
"
$DEPLOY_CPANEL_USER
"
SSL install_ssl
domain
=
"
$_cdomain
"
cert
=
"
$_cert
"
key
=
"
$_key
"
)
_debug _opt
"
$_opt
"
else
_response
=
$(
uapi SSL install_ssl
domain
=
"
$_cdomain
"
cert
=
"
$_cert
"
key
=
"
$_key
"
)
fi
fi
_response
=
$(
uapi
$_opt
SSL install_ssl
domain
=
"
$_cdomain
"
cert
=
"
$_cert
"
key
=
"
$_key
"
)
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
_err
"Error in deploying certificate:"
_err
"Error in deploying certificate:"
_err
"
$_response
"
_err
"
$_response
"
...
...
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