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

Is this Captcha code corrupt?

How to Grab email address from webform and insert into form action

Thread: "Broken" background image with Super Key