TeamViewer Forum

General Category => Teamviewer for Linux => Topic started by: joesto1 on January 29, 2011, 08:25:45 AM

Title: script to restart teamviewer5?
Post by: joesto1 on January 29, 2011, 08:25:45 AM
hi all
i have been trying to write a small script to restart teamviewer if it stop
this script seem to work (when i use crontab)  in that i updates the log but does not start teamviewer but if i run the script in terminal it works.
 so can some tell me what i have to do to get it to work


#!/bin/sh
#Script to check if the teamviewer are running.
#Script is written by joesto1
process=`ps auxwww | grep teamviewer | grep -v grep | awk '{print $1}'`
if [ -z "$process" ]; then
echo "Couldn't find teamviewer running Restarting teamviewer "`date` >>/var/cccamlog/team.check
teamviewer
else echo "teamviewer is still OK! "`date` >>/var/cccamlog/team.check
fi


thanks
i am very new to linux
joe
 ???


ps i use ubuntu 10.04