Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if ps aux | grep -v grep | grep "mjpg_streamer" > /dev/null
- then
- case "$1" in
- start)
- echo "1:Already running"
- ;;
- stop)
- killall -s SIGINT mjpg_streamer &>/dev/null
- echo "0:Stream stopped"
- ;;
- status)
- echo "1:Stream running"
- ;;
- *)
- echo "Use start/status/stop"
- ;;
- esac
- else
- case "$1" in
- start)
- 2>/dev/null 1>/dev/null mjpg_streamer -i "/usr/lib/input_uvc.so -d /dev/video0 -y -n -r 320x240 -f 15" -o "/usr/lib/output_http.so -p 8080 -w /var/www/cam" &
- echo "1:Stream started"
- ;;
- stop)
- echo "0:Stream not running"
- ;;
- status)
- echo "0:Stream not running"
- ;;
- *)
- echo "Use start/status/stop"
- ;;
- esac
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement