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.