Skip to content

Commit 5896023

Browse files
author
Kristan Kenney
committed
Minor fixes to Roundcube routine in upgrade script
Ensure that /var/lib/roundcube exists before attempting to write robots.txt file.
1 parent 43230b6 commit 5896023

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

install/upgrade/versions/latest.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,16 @@ if [ -z "$GZIP_LVL_CHECK" ]; then
114114
$BIN/v-change-sys-config-value "BACKUP_GZIP" '9'
115115
fi
116116

117-
# Randomize Rouncube des_key for better security
117+
# Randomize Roundcube des_key for better security
118118
if [ -f "/etc/roundcube/config.inc.php" ]; then
119119
rcDesKey="$(openssl rand -base64 30 | tr -d "/" | cut -c1-24)"
120120
sed -i "s/vtIOjLZo9kffJoqzpSbm5r1r/$rcDesKey/g" /etc/roundcube/config.inc.php
121121
fi
122122

123123
# Place robots.txt to prevent webmail crawling by search engine bots.
124-
if [ ! -f "/var/lib/roundcube/robots.txt" ]; then
125-
echo "User-agent: *" > /var/lib/roundcube/robots.txt
126-
echo "Disallow: /" >> /var/lib/roundcube/robots.txt
127-
fi
124+
if [ -e "/var/lib/roundcube/" ]; then
125+
if [ ! -f "/var/lib/roundcube/robots.txt" ]; then
126+
echo "User-agent: *" > /var/lib/roundcube/robots.txt
127+
echo "Disallow: /" >> /var/lib/roundcube/robots.txt
128+
fi
129+
fi

0 commit comments

Comments
 (0)