mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-23 05:31:42 +00:00
add --nocron
, for not installing default cronjob.
This commit is contained in:
parent
2ce87fe264
commit
c8e9a31ee5
21
acme.sh
21
acme.sh
@ -2156,12 +2156,16 @@ _initconf() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# nocron
|
||||||
_precheck() {
|
_precheck() {
|
||||||
|
_nocron="$1"
|
||||||
|
|
||||||
if ! _exists "curl" && ! _exists "wget"; then
|
if ! _exists "curl" && ! _exists "wget"; then
|
||||||
_err "Please install curl or wget first, we need to access http resources."
|
_err "Please install curl or wget first, we need to access http resources."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$_nocron" ] ; then
|
||||||
if ! _exists "crontab" ; then
|
if ! _exists "crontab" ; then
|
||||||
_err "It is recommended to install crontab first. try to install 'cron, crontab, crontabs or vixie-cron'."
|
_err "It is recommended to install crontab first. try to install 'cron, crontab, crontabs or vixie-cron'."
|
||||||
_err "We need to set cron job to renew the certs automatically."
|
_err "We need to set cron job to renew the certs automatically."
|
||||||
@ -2172,6 +2176,7 @@ _precheck() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if ! _exists "openssl" ; then
|
if ! _exists "openssl" ; then
|
||||||
_err "Please install openssl first."
|
_err "Please install openssl first."
|
||||||
@ -2243,14 +2248,15 @@ _installalias() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# nocron
|
||||||
install() {
|
install() {
|
||||||
|
_nocron="$1"
|
||||||
if ! _initpath ; then
|
if ! _initpath ; then
|
||||||
_err "Install failed."
|
_err "Install failed."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! _precheck ; then
|
if ! _precheck "$_nocron" ; then
|
||||||
_err "Pre-check failed, can not install."
|
_err "Pre-check failed, can not install."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -2313,7 +2319,9 @@ install() {
|
|||||||
_saveaccountconf "ACCOUNT_KEY_PATH" "$ACCOUNT_KEY_PATH"
|
_saveaccountconf "ACCOUNT_KEY_PATH" "$ACCOUNT_KEY_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$_nocron" ] ; then
|
||||||
installcronjob
|
installcronjob
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$NO_DETECT_SH" ] ; then
|
if [ -z "$NO_DETECT_SH" ] ; then
|
||||||
#Modify shebang
|
#Modify shebang
|
||||||
@ -2429,8 +2437,9 @@ Parameters:
|
|||||||
--httpport Specifies the standalone listening port. Only valid if the server is behind a reverse proxy or load balancer.
|
--httpport Specifies the standalone listening port. Only valid if the server is behind a reverse proxy or load balancer.
|
||||||
--tlsport Specifies the standalone tls listening port. Only valid if the server is behind a reverse proxy or load balancer.
|
--tlsport Specifies the standalone tls listening port. Only valid if the server is behind a reverse proxy or load balancer.
|
||||||
--listraw Only used for '--list' command, list the certs in raw format.
|
--listraw Only used for '--list' command, list the certs in raw format.
|
||||||
--stopRenewOnError, -se Only valid for '--renewall' command. Stop to renew all if one cert has error in renewal.
|
--stopRenewOnError, -se Only valid for '--renewall' command. Stop if one cert has error in renewal.
|
||||||
--insecure Do not check the server certificate, in some devices, the api server's certificate may not be trusted.
|
--insecure Do not check the server certificate, in some devices, the api server's certificate may not be trusted.
|
||||||
|
--nocron Only valid for `--install` command, which means: do not install the default cron job. In this case, the certs will not be renewed automatically.
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2485,6 +2494,7 @@ _process() {
|
|||||||
_listraw=""
|
_listraw=""
|
||||||
_stopRenewOnError=""
|
_stopRenewOnError=""
|
||||||
_insecure=""
|
_insecure=""
|
||||||
|
_nocron=""
|
||||||
while [ ${#} -gt 0 ] ; do
|
while [ ${#} -gt 0 ] ; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
|
|
||||||
@ -2722,6 +2732,9 @@ _process() {
|
|||||||
_insecure="1"
|
_insecure="1"
|
||||||
Le_Insecure="$_insecure"
|
Le_Insecure="$_insecure"
|
||||||
;;
|
;;
|
||||||
|
--nocron)
|
||||||
|
_nocron="1"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
_err "Unknown parameter : $1"
|
_err "Unknown parameter : $1"
|
||||||
return 1
|
return 1
|
||||||
@ -2733,7 +2746,7 @@ _process() {
|
|||||||
|
|
||||||
|
|
||||||
case "${_CMD}" in
|
case "${_CMD}" in
|
||||||
install) install ;;
|
install) install "$_nocron" ;;
|
||||||
uninstall) uninstall ;;
|
uninstall) uninstall ;;
|
||||||
issue)
|
issue)
|
||||||
issue "$_webroot" "$_domain" "$_altdomains" "$_keylength" "$_certpath" "$_keypath" "$_capath" "$_reloadcmd" "$_fullchainpath"
|
issue "$_webroot" "$_domain" "$_altdomains" "$_keylength" "$_certpath" "$_keypath" "$_capath" "$_reloadcmd" "$_fullchainpath"
|
||||||
|
Loading…
Reference in New Issue
Block a user