View Single Post
  #3 (permalink)  
Old 06-29-2007, 11:04 AM
dlbewley dlbewley is offline
Senior Member
 
Posts: 61
Post post upgrade

I keep a script in CVS that I pull out and run after an upgrade. I haven't used it lately and will be doing an upgrade soon, so I'll find out if it needs tweaking. Anyway, it looks like this:

Code:
#!/bin/bash
################################################################################
# $Id: postupgrade.sh,v 1.2 2007/06/29 16:51:23 dlbewley Exp $
#-------------------------------------------------------------------------------
# Run me as Zimbra after doing a Zimbra upgrade to replace local customizations.
################################################################################

SKIN_DIR=/opt/zimbra/tomcat/webapps/zimbra/skins/_base
CUSTOM_LOGO_SOURCE_URL=http://testbot/img/zimbra
LOGO_URL=http://www
ZIMLET_DIR=/opt/zimbra/zimlets-extra
ZIMBRA_USER=zimbra

if [ "`whoami`" != "$ZIMBRA_USER" ]; then
    echo "Please run as user $ZIMBRA_USER"
    exit 1
fi

# The default _base skin reverts on upgrade
echo "Replacing Logos"
for file in AppBanner.png LoginBanner.png; do
    wget -q -O $SKIN_DIR/logos/$file $CUSTOM_LOGO_SOURCE_URL/$file
done
echo "Replacing Logo URL"
cd $SKIN_DIR/base
cat < skin.patch
42a43
>       LogoURL                 = $LOGO_URL
EOF
patch base_subs.txt < skin.patch

# Zimlets become unavailable on upgrade
echo "Redeploying Zimlets"
cd $ZIMLET_DIR
for zimlet in *.zip; do
    zmzimletctl deploy $zimlet;
done

# Enforce redir to HTTPS
echo "Forcing HTTPS access only"
echo "see http://bugzilla.zimbra.com/show_bug.cgi?id=7631"
zmtlsctl mixed
cd /opt/zimbra/tomcat/webapps/zimbra/public/
cat < https.patch
100,101d99
<                       qs = emptyQs? "?initMode=" + currentProto: qs + "&initMode=" +
<                       currentProto;
EOF
patch Login.jsp < https.patch

# Apply local spamassassin customizations
echo "Apply local spamassassin customizations"
cd /opt/zimbra/conf
cat < spamassassin.patch
21,29d20
< # Begin Local Changes #
< header CAMPUS_FLAGGED_AS_SPAM X-UCD-Spam-Score =~ /^.*\(\*\*\*\*\*/
< describe CAMPUS_FLAGGED_AS_SPAM Campus claims it is spam over 5
< score CAMPUS_FLAGGED_AS_SPAM 5.0
<
< whitelist_from know@good.email
< # End Local Changes #
<
EOF
cp -p salocal.cf.in salocal.cf.in.dist
patch salocal.cf.in < spamassassin.patch

echo "I believe zimbra/tomcat/conf/keystore may need fixing."
echo "Also zimbra/conf/smtpd.crt and smtpd.key may need fixing."
echo "See migration/provision/README for info on SSL certs."
Reply With Quote