Support Solaris
This commit is contained in:
parent
d190a43e0a
commit
85c5285534
20
acme.sh
20
acme.sh
@ -808,7 +808,7 @@ _setopt() {
|
|||||||
touch "$__conf"
|
touch "$__conf"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -H -n "^$__opt$__sep" "$__conf" > /dev/null ; then
|
if grep -n "^$__opt$__sep" "$__conf" > /dev/null ; then
|
||||||
_debug2 OK
|
_debug2 OK
|
||||||
if _contains "$__val" "&" ; then
|
if _contains "$__val" "&" ; then
|
||||||
__val="$(echo $__val | sed 's/&/\\&/g')"
|
__val="$(echo $__val | sed 's/&/\\&/g')"
|
||||||
@ -816,7 +816,7 @@ _setopt() {
|
|||||||
text="$(cat $__conf)"
|
text="$(cat $__conf)"
|
||||||
echo "$text" | sed "s|^$__opt$__sep.*$|$__opt$__sep$__val$__end|" > "$__conf"
|
echo "$text" | sed "s|^$__opt$__sep.*$|$__opt$__sep$__val$__end|" > "$__conf"
|
||||||
|
|
||||||
elif grep -H -n "^#$__opt$__sep" "$__conf" > /dev/null ; then
|
elif grep -n "^#$__opt$__sep" "$__conf" > /dev/null ; then
|
||||||
if _contains "$__val" "&" ; then
|
if _contains "$__val" "&" ; then
|
||||||
__val="$(echo $__val | sed 's/&/\\&/g')"
|
__val="$(echo $__val | sed 's/&/\\&/g')"
|
||||||
fi
|
fi
|
||||||
@ -827,7 +827,7 @@ _setopt() {
|
|||||||
_debug2 APP
|
_debug2 APP
|
||||||
echo "$__opt$__sep$__val$__end" >> "$__conf"
|
echo "$__opt$__sep$__val$__end" >> "$__conf"
|
||||||
fi
|
fi
|
||||||
_debug "$(grep -H -n "^$__opt$__sep" $__conf)"
|
_debug "$(grep -n "^$__opt$__sep" $__conf)"
|
||||||
}
|
}
|
||||||
|
|
||||||
#_savedomainconf key value
|
#_savedomainconf key value
|
||||||
@ -1925,7 +1925,7 @@ renew() {
|
|||||||
|
|
||||||
IS_RENEW="1"
|
IS_RENEW="1"
|
||||||
issue "$Le_Webroot" "$Le_Domain" "$Le_Alt" "$Le_Keylength" "$Le_RealCertPath" "$Le_RealKeyPath" "$Le_RealCACertPath" "$Le_ReloadCmd" "$Le_RealFullChainPath"
|
issue "$Le_Webroot" "$Le_Domain" "$Le_Alt" "$Le_Keylength" "$Le_RealCertPath" "$Le_RealKeyPath" "$Le_RealCACertPath" "$Le_ReloadCmd" "$Le_RealFullChainPath"
|
||||||
local res=$?
|
res=$?
|
||||||
IS_RENEW=""
|
IS_RENEW=""
|
||||||
|
|
||||||
return $res
|
return $res
|
||||||
@ -1961,7 +1961,7 @@ renewAll() {
|
|||||||
|
|
||||||
|
|
||||||
list() {
|
list() {
|
||||||
local _raw="$1"
|
_raw="$1"
|
||||||
_initpath
|
_initpath
|
||||||
|
|
||||||
_sep="|"
|
_sep="|"
|
||||||
@ -2094,8 +2094,12 @@ installcronjob() {
|
|||||||
_err "Can not install cronjob, $PROJECT_ENTRY not found."
|
_err "Can not install cronjob, $PROJECT_ENTRY not found."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if _exists uname && uname -a | grep solaris >/dev/null ; then
|
||||||
|
crontab -l | { cat; echo "0 0 * * * $lesh --cron --home \"$LE_WORKING_DIR\" > /dev/null"; } | crontab --
|
||||||
|
else
|
||||||
crontab -l | { cat; echo "0 0 * * * $lesh --cron --home \"$LE_WORKING_DIR\" > /dev/null"; } | crontab -
|
crontab -l | { cat; echo "0 0 * * * $lesh --cron --home \"$LE_WORKING_DIR\" > /dev/null"; } | crontab -
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
if [ "$?" != "0" ] ; then
|
if [ "$?" != "0" ] ; then
|
||||||
_err "Install cron job failed. You need to manually renew your certs."
|
_err "Install cron job failed. You need to manually renew your certs."
|
||||||
_err "Or you can add cronjob by yourself:"
|
_err "Or you can add cronjob by yourself:"
|
||||||
@ -2111,7 +2115,11 @@ uninstallcronjob() {
|
|||||||
_info "Removing cron job"
|
_info "Removing cron job"
|
||||||
cr="$(crontab -l | grep "$PROJECT_ENTRY --cron")"
|
cr="$(crontab -l | grep "$PROJECT_ENTRY --cron")"
|
||||||
if [ "$cr" ] ; then
|
if [ "$cr" ] ; then
|
||||||
|
if _exists uname && uname -a | grep solaris >/dev/null ; then
|
||||||
|
crontab -l | sed "/$PROJECT_ENTRY --cron/d" | crontab --
|
||||||
|
else
|
||||||
crontab -l | sed "/$PROJECT_ENTRY --cron/d" | crontab -
|
crontab -l | sed "/$PROJECT_ENTRY --cron/d" | crontab -
|
||||||
|
fi
|
||||||
LE_WORKING_DIR="$(echo "$cr" | cut -d ' ' -f 9 | tr -d '"')"
|
LE_WORKING_DIR="$(echo "$cr" | cut -d ' ' -f 9 | tr -d '"')"
|
||||||
_info LE_WORKING_DIR "$LE_WORKING_DIR"
|
_info LE_WORKING_DIR "$LE_WORKING_DIR"
|
||||||
fi
|
fi
|
||||||
@ -2181,9 +2189,7 @@ _detect_profile() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local DETECTED_PROFILE
|
|
||||||
DETECTED_PROFILE=''
|
DETECTED_PROFILE=''
|
||||||
local SHELLTYPE
|
|
||||||
SHELLTYPE="$(basename "/$SHELL")"
|
SHELLTYPE="$(basename "/$SHELL")"
|
||||||
|
|
||||||
if [ "$SHELLTYPE" = "bash" ] ; then
|
if [ "$SHELLTYPE" = "bash" ] ; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user