#! /usr/bin/env bash set -e ### based on the code shared at https://community.teamviewer.com/English/discussion/comment/116988/#Comment_116988 clear cat </dev/null | awk '{ print $1 }')" if [[ ! -r "${LocalFile}" ]] || [ "$LocalSize" != "$RemoteSize" ]; then echo "Downloading file into $LocalFile..." curl -Lo "$LocalFile" "$RemoteFile" else echo "$LocalFile exists and is same size as on server, using existing file..." fi rm -fR /tmp/tvqs 2>&1 > /dev/null mkdir -p /tmp/tvqs pushd /tmp/tvqs > /dev/null tar xzf "$LocalFile" cd teamviewerqs echo "Launching TeamViewer Quick Support in the background from $PWD, it should startup in a few seconds..." ./teamviewer & sleep 8 popd printf "TeamViewer launched, you might want to hit if you don't see the prompt\n\n"