From 670b709f8f37e99102a1290fa7ff3dcc4fcac041 Mon Sep 17 00:00:00 2001 From: James Weir Date: Mon, 22 Jun 2015 13:26:16 +1000 Subject: [PATCH] Added if statements to check for directories/files before removing them. Updated download location to include $release structure from http://c.vestacp.com/0.9.8/rhel/ Fixed error message that appears if /etc/dovecot doesn't exist when chowning. --- install/vst-install-rhel.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 218c0840..b90320cb 100644 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -725,12 +725,19 @@ fi if [ "$release" -eq '5' ]; then wget $CHOST/$VERSION/dovecot.conf -O /etc/dovecot.conf else - wget $CHOST/$VERSION/dovecot.tar.gz -O /etc/dovecot.tar.gz - cd /etc/ - rm -rf dovecot + wget $CHOST/$VERSION/$release/dovecot.tar.gz -O /etc/dovecot.tar.gz + cd /etc + if [ -d /etc/dovecot ]; then + rm -rf /etc/dovecot + fi + if [ -f /etc/dovecot.conf ]; then + rm /etc/dovecot.conf + fi tar -xzf dovecot.tar.gz rm -f dovecot.tar.gz - chown -R root:root /etc/dovecot + if [ -d /etc/dovecot ]; then + chown -R root:root /etc/dovecot + fi fi gpasswd -a dovecot mail chkconfig dovecot on