Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 1c025f937a77546674c04f23aa8ed60a > scriptlet

squirrelmail-1.4.20-0.RC2.2mdv2010.0.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_config.php --newfile /etc/squirrelmail/plugins/change_pass_config.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
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/abook_import_export_config.php --newfile /etc/squirrelmail/plugins/abook_import_export_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/javascript_libs_config.php --newfile /etc/squirrelmail/plugins/javascript_libs_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/yubikey_config.php --newfile /etc/squirrelmail/plugins/yubikey_config.php.rpmnew
ccp --delete --ifexists --set "NoOrphans" --ignoreopt config_version --oldfile /etc/squirrelmail/plugins/yubikey_glogal_config.php --newfile /etc/squirrelmail/plugins/yubikey_glogal_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