#!/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
}

# Download teamviewer installation file #
wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb || error "Failed to download teamviewer-host_armhf.deb"

# Install it with dpkg 
sudo apt install -y --fix-broken ~/teamviewer-host_armhf.deb || error "Failed to install teamviewer-host_armhf.deb"

# Delete teamviewer installation file
rm -f ~/teamviewer-host_armhf.deb
