%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/lib/dpkg/info/
Upload File :
Create Path :
Current File : /var/lib/dpkg/info/veeam.prerm

#!/bin/sh

set -e

PATH=$PATH:/usr/sbin

if [ -d /run/systemd/system ]
then
    # systemd
    case "$1" in
        remove|remove-in-favour|deconfigure|deconfigure-in-favour)
            if systemctl is-active veeamservice >/dev/null 2>&1
            then
                echo "Stop veeamservice"
                systemctl stop veeamservice || true
                rmmod veeamsnap >/dev/null 2>&1 || true
            fi

            echo "Disable veeamservice"
            systemctl disable veeamservice

            /usr/sbin/veeamservice --uninstall 2>&1 || true
        ;;

        upgrade | failed-upgrade)
            if systemctl is-active veeamservice >/dev/null 2>&1
            then
                echo "Stop veeamservice"
                systemctl stop veeamservice || true
                rmmod veeamsnap >/dev/null 2>&1 || true
            fi

            echo "Disable veeamservice"
            systemctl disable veeamservice
        ;;
    esac
else
    # init
    case "$1" in
        remove|remove-in-favour|deconfigure|deconfigure-in-favour)
            if which invoke-rc.d >/dev/null 2>&1
            then
                invoke-rc.d veeamservice stop
            else
                /etc/init.d/veeamservice stop
            fi

            if which update-rc.d >/dev/null 2>&1
            then
                update-rc.d -f veeamservice remove || exit 0
            fi

            /usr/sbin/veeamservice --uninstall || true        
        ;;

        upgrade | failed-upgrade)
        ;;

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

fi

exit 0

Zerion Mini Shell 1.0