View Single Post
Posts: 13 | Thanked: 0 times | Joined on Jan 2010
#7
Yes that was pretty clear but the cat command doesn't work on my mobile, don't know why. I installed openssh and copied it to my pc.

So here we go:

Code:
#!/bin/sh
# prerm script for imhere
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    upgrade|remove|failed-upgrade|deconfigure)
    
    UNINSTALL_NAME='/etc/init.d/imhere-0.3.uninstall'

    if [ -f $UNINSTALL_NAME ];
    then
        PROGRAM_NAME='/usr/bin/imhere-0.3'
        ps ax | grep -v grep | grep $PROGRAM_NAME > /dev/null
        if [ $? -eq 0 ]; then
            killall 'imhere-0.3'
        fi
    else
        echo "remove/upgrade not enabled \`$1'" >&2
        exit 1
    fi

    ;;

    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.



exit 0