#!/bin/bash

DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")"

function error {
  echo -e "\\e[91m$1\\e[39m"
  exit 1
}

cd $HOME
wget https://github.com/angryip/ipscan/releases/download/3.7.6/ipscan_3.7.6_all.deb
# Get dependencies
"${DIRECTORY}/pkg-install" "openjdk-11-jdk rpm fakeroot" "$(dirname "$0")" || exit 1
sudo apt --fix-broken -y install ~/ipscan_3.7.6_all.deb
rm ~/ipscan_3.7.6_all.deb
