#!/bin/bash

set -e

if [ "$1" = "configure" ]
then

    echo "Set permission 1777 for /var/backups/vim"
        chmod 1777 /var/backups/vim

    echo -n "Setting default editor to vim "
    if [ ! -x /usr/bin/vim.basic ]
    then
        echo "vim.basic not found!"
    else
        update-alternatives --set editor /usr/bin/vim.basic
        echo "done."
    fi

    if dpkg --compare-versions "$2" lt "9.00~ee90"
    then
        if [ -x "/etc/init.d/rsyslog" ]
        then
            invoke-rc.d rsyslog restart || true
        else
            echo "Warning, rsyslog doesn't seems to be installed, netfilter logs won't be automatically redirected!"
        fi
    fi
    if dpkg --compare-versions "$2" eq "9.00~ee90+10"
    then
        # Remove incidently added file
        rm -f /etc/profile.d/ee-git-pf.sh || true
    fi
fi

#DEBHELPER#

exit 0
