Browse Source

Add reloadcmd support for cron flag.

pull/1814/head
Sam Batschelet 6 years ago
parent
commit
850d7ba9eb
  1. 43
      acme.sh

43
acme.sh

@ -4713,19 +4713,7 @@ _installcert() {
fi fi
if [ "$_reload_cmd" ]; then if [ "$_reload_cmd" ]; then
_info "Run reload cmd: $_reload_cmd"
if (
export CERT_PATH
export CERT_KEY_PATH
export CA_CERT_PATH
export CERT_FULLCHAIN_PATH
export Le_Domain
cd "$DOMAIN_PATH" && eval "$_reload_cmd"
); then
_info "$(__green "Reload success")"
else
_err "Reload error for :$Le_Domain"
fi
_eval_reload_cmd "$_reload_cmd"
fi fi
} }
@ -5388,6 +5376,12 @@ _uninstallalias() {
} }
cron() { cron() {
_reload_cmd="$1"
if [ "$_reload_cmd" = "$NO_VALUE" ]; then
_reload_cmd=""
fi
export IN_CRON=1 export IN_CRON=1
_initpath _initpath
_info "$(__green "===Starting cron===")" _info "$(__green "===Starting cron===")"
@ -5409,11 +5403,32 @@ cron() {
fi fi
renewAll renewAll
_ret="$?" _ret="$?"
if [ "$_reload_cmd" ]; then
_eval_reload_cmd "$_reload_cmd"
fi
IN_CRON="" IN_CRON=""
_info "$(__green "===End cron===")" _info "$(__green "===End cron===")"
exit $_ret exit $_ret
} }
_eval_reload_cmd() {
_reload_cmd="$1"
_info "Run reload cmd: $_reload_cmd"
if (
export CERT_PATH
export CERT_KEY_PATH
export CA_CERT_PATH
export CERT_FULLCHAIN_PATH
export Le_Domain
cd "$DOMAIN_PATH" && eval "$_reload_cmd"
); then
_info "$(__green "Reload success")"
else
_err "Reload error for :$Le_Domain"
fi
}
version() { version() {
echo "$PROJECT" echo "$PROJECT"
echo "v$VER" echo "v$VER"
@ -6168,7 +6183,7 @@ _process() {
;; ;;
installcronjob) installcronjob "$_confighome" ;; installcronjob) installcronjob "$_confighome" ;;
uninstallcronjob) uninstallcronjob ;; uninstallcronjob) uninstallcronjob ;;
cron) cron ;;
cron) cron "$_reloadcmd" ;;
toPkcs) toPkcs)
toPkcs "$_domain" "$_password" "$_ecc" toPkcs "$_domain" "$_password" "$_ecc"
;; ;;

Loading…
Cancel
Save