#!/bin/sh
CFVERSION=$(cfversion)
if [ ${CFVERSION%.*} -gt 1440 ] || [ -f /.meridian_installed ]; then

    # undo "damage" caused by the preinst script

    LIB=/usr/lib/com.r333d.eqe
    NEW_DIR="/Library/Application Support/com.r333d.eqe"

    if [ -d "$NEW_DIR" ] && [ -z "$(ls -A "$NEW_DIR")" ]; then
        rmdir "$NEW_DIR"
    fi
    if [ -d $LIB ] && [ -z "$(ls -A $LIB)" ]; then
        rmdir $LIB
    fi
fi

# kill daemons
killall mediaserverd callservicesd || true
