Skip to content

Commit 670b709

Browse files
committed
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.
1 parent 5b06701 commit 670b709

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

install/vst-install-rhel.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,19 @@ fi
725725
if [ "$release" -eq '5' ]; then
726726
wget $CHOST/$VERSION/dovecot.conf -O /etc/dovecot.conf
727727
else
728-
wget $CHOST/$VERSION/dovecot.tar.gz -O /etc/dovecot.tar.gz
729-
cd /etc/
730-
rm -rf dovecot
728+
wget $CHOST/$VERSION/$release/dovecot.tar.gz -O /etc/dovecot.tar.gz
729+
cd /etc
730+
if [ -d /etc/dovecot ]; then
731+
rm -rf /etc/dovecot
732+
fi
733+
if [ -f /etc/dovecot.conf ]; then
734+
rm /etc/dovecot.conf
735+
fi
731736
tar -xzf dovecot.tar.gz
732737
rm -f dovecot.tar.gz
733-
chown -R root:root /etc/dovecot
738+
if [ -d /etc/dovecot ]; then
739+
chown -R root:root /etc/dovecot
740+
fi
734741
fi
735742
gpasswd -a dovecot mail
736743
chkconfig dovecot on

0 commit comments

Comments
 (0)