Sophie

Sophie

distrib > Mandriva > cs4.0 > x86_64 > by-pkgid > 25027420da62356ea3d7548652eff44f > scriptlet

squirrelmail-1.4.8-3.1.20060mlcs4.noarch.rpm

POSTIN

/bin/sh
# Put correct hostname in config. We do this every time, since we change the
# .rpmnew as well. This is safe even if someone already modified the config,
# because the script will not find __HOSTNAME__ in the file and will do
# nothing.
for f in /etc/squirrelmail/config.php /etc/squirrelmail/config.php.rpmnew \
    /etc/squirrelmail/plugins/avelsieve_config.php /var/www/squirrelmail/plugins/avelsieve/addrule_html.php; do
    perl -pi -e "s|__HOSTNAME__|$HOSTNAME|g" $f 2>/dev/null
done

# Upgrade the configuration file using ccp if needed
# --ifexists makes sure it doesn't do anything (or whine/return nonzero)
# --ignoreopt config_version makes sure the config_version in config.php.rpmnew is kept
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/config.php --newfile /etc/squirrelmail/config.php.rpmnew

# try to fix the plugins config too
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/avelsieve_config.php --newfile /etc/squirrelmail/plugins/avelsieve_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/change_ldappass_config.php --newfile /etc/squirrelmail/plugins/change_ldappass_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/change_pass_settings.php --newfile /etc/squirrelmail/plugins/change_pass_settings.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/empty_folders_config.php --newfile /etc/squirrelmail/plugins/empty_folders_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/folder_sizes_config.php --newfile /etc/squirrelmail/plugins/folder_sizes_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/ldifimport_config.php --newfile /etc/squirrelmail/plugins/ldifimport_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/quota_usage_config.php --newfile /etc/squirrelmail/plugins/quota_usage_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/secure_login_config.php --newfile /etc/squirrelmail/plugins/secure_login_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/select_range_config.php --newfile /etc/squirrelmail/plugins/select_range_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/spamassassin_config.php --newfile /etc/squirrelmail/plugins/spamassassin_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/spam_buttons_config.php --newfile /etc/squirrelmail/plugins/spam_buttons_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/sqspell_config.php --newfile /etc/squirrelmail/plugins/sqspell_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/username_config.php --newfile /etc/squirrelmail/plugins/username_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/junkfolder_config.php --newfile /etc/squirrelmail/plugins/junkfolder_config.php.rpmnew

if [ -f /var/lock/subsys/httpd ]; then
    /etc/rc.d/init.d/httpd restart 1>&2;
fi

POSTUN

/bin/sh
if [ "$1" = "0" ]; then
    if [ -f /var/lock/subsys/httpd ]; then
	/etc/rc.d/init.d/httpd restart 1>&2
    fi
fi