#!/bin/bash

cd ${0%/*}

echo
echo "Copyright Pointsharp AB"
echo

if [ "$(id -u)" != "0" ]; then
    echo "ERROR - Uninstallation requires root access"
    exit
fi

echo "Uninstall begin"
APP_PATH=/usr/bin/netid-access
if [ -d "$APP_PATH" ]; then
    echo "  Delete application"
    rm -rf "$APP_PATH"
    rmdir --ignore-fail-on-non-empty ${APP_PATH%/*}
fi
if [ -f "/usr/share/applications/netidaccess.desktop" ]; then
    echo "  Delete desktop link"
    rm -rf "/usr/share/applications/netidaccess.desktop"
fi

echo "  Update desktop database"
update-desktop-database
echo "Uninstall end"
