From 85596f08cfb31393d548de76d33859b9517a383a Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 10 Sep 2022 23:12:16 +0500 Subject: [PATCH] bug fix that causes upgrade to stuck --- plogical/upgrade.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 0957c25b5..124d0f316 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -2563,9 +2563,10 @@ vmail command = """sed -i '/CyberCP/d' /etc/crontab""" subprocess.call(command, shell=True) - # Setup /usr/local/lsws/conf/httpd.conf to use new Logformat standard for better stats and accesslogs - command = """sed -i "s|^LogFormat.*|LogFormat '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' combined|g" /usr/local/lsws/conf/httpd.conf""" - subprocess.call(command, shell=True) + if os.path.exists('/usr/local/lsws/conf/httpd.conf'): + # Setup /usr/local/lsws/conf/httpd.conf to use new Logformat standard for better stats and accesslogs + command = """sed -i "s|^LogFormat.*|LogFormat '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' combined|g" /usr/local/lsws/conf/httpd.conf""" + subprocess.call(command, shell=True) # Fix all existing vhost confs to use new Logformat standard for better stats and accesslogs command = """find /usr/local/lsws/conf/vhosts/ -type f -name 'vhost.conf' -exec sed -i "s/.*CustomLog.*/ LogFormat '%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"' combined\n&/g" {} \;"""