Advertisement
Skew

Skrypt do kontroli serwera mjpg-streamer

Nov 4th, 2014
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if ps aux | grep -v grep | grep "mjpg_streamer" > /dev/null
  4. then
  5.     case "$1" in
  6.         start)
  7.             echo "1:Already running"
  8.             ;;
  9.         stop)
  10.             killall -s SIGINT mjpg_streamer &>/dev/null
  11.             echo "0:Stream stopped"
  12.             ;;
  13.         status)
  14.             echo "1:Stream running"
  15.             ;;
  16.         *)
  17.             echo "Use start/status/stop"
  18.             ;;
  19.     esac
  20. else
  21.     case "$1" in
  22.         start)
  23.             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" &
  24.             echo "1:Stream started"
  25.             ;;
  26.         stop)
  27.             echo "0:Stream not running"
  28.             ;;
  29.         status)
  30.             echo "0:Stream not running"
  31.             ;;
  32.         *)
  33.             echo "Use start/status/stop"
  34.             ;;
  35.     esac
  36. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement