From e23301f707cced89104069cf796cd6ee88691d3f Mon Sep 17 00:00:00 2001 From: DrDrrae Date: Thu, 10 Aug 2017 21:28:18 -0400 Subject: [PATCH] Remove parts of code related to editing, backing up and restoring lighttpd config file as it didn't work anyway. --- deploy/lighttpd.sh | 61 +--------------------------------------------- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/deploy/lighttpd.sh b/deploy/lighttpd.sh index 2c4e5d47..2eca932a 100644 --- a/deploy/lighttpd.sh +++ b/deploy/lighttpd.sh @@ -4,7 +4,6 @@ #returns 0 means success, otherwise error. -#DEPLOY_LIGHTTTPD_CONF="/etc/lighttpd/lighttpd.conf" #DEPLOY_LIGHTTTPD_RELOAD="service lighttpd restart" ######## Public functions ##################### @@ -44,59 +43,9 @@ lighttpd_deploy() { DEFAULT_LIGHTTTPD_RELOAD="service lighttpd restart" _reload="${DEPLOY_LIGHTTTPD_RELOAD:-$DEFAULT_LIGHTTTPD_RELOAD}" - if [ -z "$IS_RENEW" ]; then - DEFAULT_LIGHTTTPD_CONF="/etc/lighttpd/lighttpd.conf" - _LIGHTTTPD_conf="${DEPLOY_LIGHTTTPD_CONF:-$DEFAULT_LIGHTTTPD_CONF}" - if [ ! -f "$_LIGHTTTPD_conf" ]; then - if [ -z "$DEPLOY_LIGHTTTPD_CONF" ]; then - _err "lighttpd conf is not found, please define DEPLOY_LIGHTTTPD_CONF" - return 1 - else - _err "It seems that the specified lighttpd conf is not valid, please check." - return 1 - fi - fi - if [ ! -w "$_LIGHTTTPD_conf" ]; then - _err "The file $_LIGHTTTPD_conf is not writable, please change the permission." - return 1 - fi - _backup_conf="$DOMAIN_BACKUP_PATH/lighttpd.conf.bak" - _info "Backup $_LIGHTTTPD_conf to $_backup_conf" - if ! mkdir -p "$DOMAIN_BACKUP_PATH"; then - _err "Can not create folder:$DOMAIN_BACKUP_PATH" - return 1 - fi - if ! cat "$_LIGHTTTPD_conf" >"$_backup_conf"; then - _err "Can not backup Lighttpd config to $_backup_conf" - return 1 - fi - -# _info "Modify lighttpd conf: $_LIGHTTTPD_conf" -# if _setopt "$_LIGHTTTPD_conf" "ssl.pemfile" "=" "$_real_combinedkeyandcert" \ -# && _setopt "$_LIGHTTTPD_conf" "ssl.ca-file" "=" "$_real_ca" \ -# && _setopt "$_LIGHTTTPD_conf" "ssl.engine" "=" "YES"; then -# _info "Set config success!" -# else -# _err "Config lighttpd server error, please report bug to us." -# _info "Restoring lighttpd conf" -# if cat "$_backup_conf" >"$_LIGHTTTPD_conf"; then -# _info "Restore conf success" -# eval "$_reload" -# else -# _err "Oops, error restore lighttpd conf, please report bug to us." -# fi -# return 1 -# fi - fi - _info "Run reload: $_reload" if eval "$_reload"; then _info "Reload success!" - if [ "$DEPLOY_LIGHTTTPD_CONF" ]; then - _savedomainconf DEPLOY_LIGHTTTPD_CONF "$DEPLOY_LIGHTTTPD_CONF" - else - _cleardomainconf DEPLOY_LIGHTTTPD_CONF - fi if [ "$DEPLOY_LIGHTTTPD_RELOAD" ]; then _savedomainconf DEPLOY_LIGHTTTPD_RELOAD "$DEPLOY_LIGHTTTPD_RELOAD" else @@ -104,15 +53,7 @@ lighttpd_deploy() { fi return 0 else - _err "Reload error, restoring" - if cat "$_backup_conf" >"$_LIGHTTTPD_conf"; then - _info "Restore conf success" - eval "$_reload" - else - _err "Oops, error restore lighttpd conf, please report bug to us." - fi return 1 fi return 0 - -} \ No newline at end of file +}