Skip to main content

Thread: unable to start or stop motion with script


i have following script pretty check status of motion daemon , based on stop or start daemon, have added command along username sudoers file don't have run script sudo credentials; however, script unable start or stop service.

code:
#!/bin/bash # script start/stop motion , remove content file # 11/5/2012  dir=/tmp/motion  ps -e | grep motion if [ $? -eq 0 ]; 	#motion running , need stop 	echo "stopping motion , removing files..." 	service motion stop  	if [ -d $dir ]; 		rm -rf $dir/ 2> /dev/null 	fi 	 else 	#motion not running , need start 	echo "starting motion..." 	service motion start fi
output when trying start
code:
jorge@nixboxen:~$ ./mocheck.sh  starting motion... chown: changing ownership of `/var/run/motion': operation not permitted
output when trying stop
code:
stopping motion , removing files...  * stopping motion detection daemon motion  no /usr/bin/motion found running; none killed.                                                                [ ok ]



Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk unable to start or stop motion with script


Ubuntu

Comments

Popular posts from this blog

Could not place because the source rectangle is empty

Thread: Using smartcard reader with vpnc

Adobe Font Folio 7.0 or just 7?