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
79c2453a
Commit
79c2453a
authored
Jan 23, 2016
by
neil
Browse files
separate "installcert" from "issue" command.
parent
6e89f811
Changes
1
Show whitespace changes
Inline
Side-by-side
le.sh
View file @
79c2453a
...
@@ -714,33 +714,7 @@ issue() {
...
@@ -714,33 +714,7 @@ issue() {
_setopt
"
$DOMAIN_CONF
"
"Le_NextRenewTimeStr"
"="
"
\"
$Le_NextRenewTimeStr
\"
"
_setopt
"
$DOMAIN_CONF
"
"Le_NextRenewTimeStr"
"="
"
\"
$Le_NextRenewTimeStr
\"
"
if
[
"
$Le_RealCertPath
"
]
;
then
installcert
$Le_Domain
"
$Le_RealCertPath
"
"
$Le_RealKeyPath
"
"
$Le_RealCACertPath
"
"
$Le_ReloadCmd
"
if
[
-f
"
$Le_RealCertPath
"
]
;
then
cp
-p
"
$Le_RealCertPath
"
"
$Le_RealCertPath
"
.bak
fi
cat
"
$CERT_PATH
"
>
"
$Le_RealCertPath
"
fi
if
[
"
$Le_RealCACertPath
"
]
;
then
if
[
-f
"
$Le_RealCACertPath
"
]
;
then
cp
-p
"
$Le_RealCACertPath
"
"
$Le_RealCACertPath
"
.bak
fi
cat
"
$CA_CERT_PATH
"
>
"
$Le_RealCACertPath
"
fi
if
[
"
$Le_RealKeyPath
"
]
;
then
if
[
-f
"
$Le_RealKeyPath
"
]
;
then
cp
-p
"
$Le_RealKeyPath
"
"
$Le_RealKeyPath
"
.bak
fi
cat
"
$CERT_KEY_PATH
"
>
"
$Le_RealKeyPath
"
fi
if
[
"
$Le_ReloadCmd
"
]
;
then
_info
"Run Le_ReloadCmd:
$Le_ReloadCmd
"
$Le_ReloadCmd
fi
}
}
...
@@ -807,6 +781,47 @@ renewAll() {
...
@@ -807,6 +781,47 @@ renewAll() {
}
}
installcert
()
{
Le_Domain
=
"
$1
"
if
[
-z
"
$Le_Domain
"
]
;
then
_err
"Usage:
$0
domain.com [cert-file-path]|no [key-file-path]|no [ca-cert-file-path]|no [reloadCmd]|no"
return
1
fi
Le_RealCertPath
=
"
$2
"
Le_RealKeyPath
=
"
$3
"
Le_RealCACertPath
=
"
$4
"
Le_ReloadCmd
=
"
$5
"
_initpath
$Le_Domain
_setopt
"
$DOMAIN_CONF
"
"Le_RealCertPath"
"="
"
\"
$Le_RealCertPath
\"
"
_setopt
"
$DOMAIN_CONF
"
"Le_RealCACertPath"
"="
"
\"
$Le_RealCACertPath
\"
"
_setopt
"
$DOMAIN_CONF
"
"Le_RealKeyPath"
"="
"
\"
$Le_RealKeyPath
\"
"
_setopt
"
$DOMAIN_CONF
"
"Le_ReloadCmd"
"="
"
\"
$Le_ReloadCmd
\"
"
if
[
"
$Le_RealCACertPath
"
]
;
then
if
[
-f
"
$Le_RealCACertPath
"
]
;
then
cp
-p
"
$Le_RealCACertPath
"
"
$Le_RealCACertPath
"
.bak
fi
cat
"
$CA_CERT_PATH
"
>
"
$Le_RealCACertPath
"
fi
if
[
"
$Le_RealKeyPath
"
]
;
then
if
[
-f
"
$Le_RealKeyPath
"
]
;
then
cp
-p
"
$Le_RealKeyPath
"
"
$Le_RealKeyPath
"
.bak
fi
cat
"
$CERT_KEY_PATH
"
>
"
$Le_RealKeyPath
"
fi
if
[
"
$Le_ReloadCmd
"
]
;
then
_info
"Run Le_ReloadCmd:
$Le_ReloadCmd
"
$Le_ReloadCmd
fi
}
install
()
{
install
()
{
_initpath
_initpath
if
!
command
-v
"curl"
>
/dev/null
;
then
if
!
command
-v
"curl"
>
/dev/null
;
then
...
@@ -890,7 +905,7 @@ version() {
...
@@ -890,7 +905,7 @@ version() {
}
}
showhelp
()
{
showhelp
()
{
version
version
echo
"Usage: issue|renew|renewAll|createAccountKey|createDomainKey|createCSR|install|uninstall|version"
echo
"Usage: issue|
installcert|
renew|renewAll|createAccountKey|createDomainKey|createCSR|install|uninstall|version"
}
}
...
...
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