#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Variables
DOWNLOAD_URL="http://willsbros.eu/teamviewer-host.deb"
DEB_FILE="teamviewer-host.deb"
API_TOKEN="12168743-EmQLTeBsMV7UrGEHrDCy"
HOSTNAME=$(hostname)
echo "Downloading TeamViewer Host..."
wget -O "$DEB_FILE" "$DOWNLOAD_URL"
echo "Installing TeamViewer Host..."
sudo apt update sudo apt install -y ./"$DEB_FILE"
echo "Assigning TeamViewer to account..."
sudo teamviewer -assign -api-token "$API_TOKEN" -alias "$HOSTNAME" -group auto -grant-easy-access
echo "Done!"