Skip to content

Instantly share code, notes, and snippets.

@Dirack
Created August 4, 2021 18:01
Show Gist options
  • Save Dirack/422288427d9947401bc829dad6df4db5 to your computer and use it in GitHub Desktop.
Save Dirack/422288427d9947401bc829dad6df4db5 to your computer and use it in GitHub Desktop.

Simple Script To Start Teamviewer Through Terminal.

link

Hi All,

Today i came with some different script and very simple script 🙂 To start the team viewer remotely.

#!/bin/bash
echo “Killing existing teamviewer”
existingprocess=`ps -ef | grep teamviewer | awk ‘{print $2}’`
for process in $existingprocess;
do
kill -9 $process
echo “Existing process ID killed”
done
echo “STARTING NEW TEAMVIEWER SESSION”
nohup sh /opt/teamviewer/teamviewer/7/bin/teamviewer > /dev/null 2>&1 &

a) simple for loop iam using in this script to get the existing process id’s and kill the old process id’s

b) Then using the default script which given by teamviewer itself, we need to start and run the process in background so that i used nohup command.

Nohup stands for no hang up, which can be executed as shown below. it is very helpful when you have to execute a shell-script or command that take a long time to finish. In that case, you don’t want to be connected to the shell and waiting for the command to complete. Instead, execute it with nohup, exit the shell and continue with your other work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment