#!/bin/sh # If we're an upgrade, skip all of this cleanup if [ "$1" != "upgrade" ]; then # Clean up installinfo.txt file (registered as "conf" file to pass rpmcheck) rm -f /etc/opt/microsoft/mysql-cimprov/conf/installinfo.txt* rmdir /etc/opt/microsoft/mysql-cimprov/conf 2> /dev/null rmdir /etc/opt/microsoft/mysql-cimprov 2> /dev/null rmdir /etc/opt/microsoft 2> /dev/null rmdir /etc/opt 2> /dev/null fi # Calling sequence for RPM pre/post scripts, during upgrade, is as follows: # 1. Run the %pre section of the RPM being installed. # 2. Install the files that the RPM provides. # 3. Run the %post section of the RPM. # 4. Run the %preun of the old package. # 5. Delete any old files not overwritten by the newer version. # (This step deletes files that the new package does not require.) # 6. Run the %postun hook of the old package. # # Thus, if we're an upgrade, skip all of this cleanup if [ "$1" != "upgrade" ]; then # Remove linkage in case it exists MYSQL_BUILD_LIBRARY=libmysqlclient.so.15 LIBRARY_DIR='/opt/microsoft/mysql-cimprov/lib' [ -e ${LIBRARY_DIR}/${MYSQL_BUILD_LIBRARY} ] && rm ${LIBRARY_DIR}/${MYSQL_BUILD_LIBRARY} rmdir /opt/microsoft/mysql-cimprov/lib 2> /dev/null rmdir /opt/microsoft/mysql-cimprov 2> /dev/null rmdir /opt/microsoft 2> /dev/null rmdir /opt 2> /dev/null fi # If we're called for upgrade, don't do anything if [ "$1" != "upgrade" ]; then # Reload the OMI server /opt/omi/bin/service_control reload fi exit 0