%preun if [ $1 = 0 ]; then // Do stuff specific to uninstalls /usr/sbin/patchmanager -u sailfishos-shutdown-screen else if [ $1 = 1 ]; then // Do stuff specific to upgrades echo "It's just upgrade" fi fi