Browse Source

fix format

cron
neilpang 8 years ago
parent
commit
302c41edc9
  1. 18
      acme.sh

18
acme.sh

@ -2353,7 +2353,7 @@ _setNginx() {
_info "OK, Set up nginx config file" _info "OK, Set up nginx config file"
if ! sed -n "1,${_ln}p" "$_backup_conf" > "$FOUND_REAL_NGINX_CONF"; then
if ! sed -n "1,${_ln}p" "$_backup_conf" >"$FOUND_REAL_NGINX_CONF"; then
cat "$_backup_conf" >"$FOUND_REAL_NGINX_CONF" cat "$_backup_conf" >"$FOUND_REAL_NGINX_CONF"
_err "write nginx conf error, but don't worry, the file is restored to the original version." _err "write nginx conf error, but don't worry, the file is restored to the original version."
return 1 return 1
@ -2415,7 +2415,7 @@ _checkConf() {
fi fi
if grep "^ *include *.*;" "$2" >/dev/null; then if grep "^ *include *.*;" "$2" >/dev/null; then
_debug "Try include files" _debug "Try include files"
for included in $(grep "^ *include *.*;" "$2"| sed "s/include //" | tr -d " ;" ); do
for included in $(grep "^ *include *.*;" "$2" | sed "s/include //" | tr -d " ;"); do
_debug "check included $included" _debug "check included $included"
if _checkConf "$1" "$included"; then if _checkConf "$1" "$included"; then
return 0 return 0
@ -2433,11 +2433,17 @@ _checkConf() {
#d , conf #d , conf
_isRealNginxConf() { _isRealNginxConf() {
_debug "_isRealNginxConf $1 $2" _debug "_isRealNginxConf $1 $2"
if [ -f "$2" ] && grep "^ *server_name " "$2" | grep " $1" >/dev/null; then
if [ -f "$2" ]; then
for _fln in $(grep -n "^ *server_name.* $1" "$2" | cut -d : -f 1); do
_debug _fln "$_fln"
if [ "$_fln" ]; then
_listen=$(cat "$2" | _head_n "$_fln" | grep "^ *listen .*" | _tail_n 1)
fi
done
return 0 return 0
else
return 1
fi fi
return 1
} }
#restore all the nginx conf #restore all the nginx conf
@ -2455,7 +2461,7 @@ _restoreNginx() {
_ngconf=$(echo "$ng_entry" | cut -d "$sep" -f 2) _ngconf=$(echo "$ng_entry" | cut -d "$sep" -f 2)
_ngbackupconf=$(echo "$ng_entry" | cut -d "$sep" -f 3) _ngbackupconf=$(echo "$ng_entry" | cut -d "$sep" -f 3)
_info "Restoring from $_ngbackupconf to $_ngconf" _info "Restoring from $_ngbackupconf to $_ngconf"
cat "$_ngbackupconf" > "$_ngconf"
cat "$_ngbackupconf" >"$_ngconf"
done done
_info "Reload nginx" _info "Reload nginx"

Loading…
Cancel
Save