- # Backup first.
- if cp_check_and_backup "$CONF" "$backup_name"; then
- cp_echo "CN: Old $CONF saved as \"/var/backups/$backup_name.bak\"."
- fi
-
- # Check if we already modified apache.conf
- if ! egrep -q "^[ ]+RewriteRule \. https" "$CONF"; then
-
- echo -n "CN: Updating Apache2 configuration for Squirrelmail"
- perl -n -e 'print if ! m|^Alias\s*/webmail|' "$CONF" > $CONF.tmp
-
- cp-update -t squirrelmail-cn $CONF.tmp <<-EOF
- # Force SSL for /webmail -> you can still use /squirrelmail
- Alias /webmail /usr/share/squirrelmail
-
- <IfModule mod_rewrite.c>
- <IfModule mod_ssl.c>
- <Location /webmail>
- RewriteEngine on
- RewriteCond %{HTTPS} !=on
- RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
- </Location>
- </IfModule>
- </IfModule>
-
- #
- # WARNING: This file is automatically included in each VirtualHost
- # entry you might have. Do not enable the VirtualHost example provided
- # in this file, it WILL break your Apache configuration. Copy the
- # VirtualHost section to the standard webserver configuration file
- # instead.
- #
- EOF
- cp_mv $CONF.tmp $CONF
-
- # This will break if cp_backup_conffile ever changes destination path
- if ! cmp -s "$CONF" "/var/backups/$backup_name.bak"; then
- echo "."
- cp_echo "CN: Updated Apache2 configuration for Squirrelmail."
- need_restart=1
- else
- echo "... no changes."
- fi
+ # Backup first.
+ if cp_check_and_backup "$CONF" "$backup_name"; then
+ cp_echo "CN: Old $CONF saved as \"/var/backups/$backup_name.bak\"."
+ fi
+
+ # Check if we already modified apache.conf
+ if ! egrep -q "^[ ]+RewriteRule \. https" "$CONF"; then
+ echo -n "CN: Updating Apache2 configuration for Squirrelmail"
+ perl -n -e 'print if ! m|^Alias\s*/webmail|' "$CONF" > $CONF.tmp
+
+ cp-update -t squirrelmail-cn $CONF.tmp <<-EOF
+# Force SSL for /webmail -> you can still use /squirrelmail
+Alias /webmail /usr/share/squirrelmail
+
+<IfModule mod_rewrite.c>
+ <IfModule mod_ssl.c>
+ <Location /webmail>
+ RewriteEngine on
+ RewriteCond %{HTTPS} !=on
+ RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
+ </Location>
+ </IfModule>
+</IfModule>
+
+#
+# WARNING: This file is automatically included in each VirtualHost
+# entry you might have. Do not enable the VirtualHost example provided
+# in this file, it WILL break your Apache configuration. Copy the
+# VirtualHost section to the standard webserver configuration file
+# instead.
+#
+EOF
+ cp_mv $CONF.tmp $CONF
+
+ # This will break if cp_backup_conffile ever changes destination path
+ if ! cmp -s "$CONF" "/var/backups/$backup_name.bak"; then
+ echo "."
+ cp_echo "CN: Updated Apache2 configuration for Squirrelmail."
+ need_restart=1
+ else
+ echo "... no changes."