Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- #
- # rc.local
- #
- # This script is executed at the end of each multiuser runlevel.
- # Make sure that the script will "exit 0" on success or any other
- # value on error.
- #
- # In order to enable or disable this script just change the execution
- # bits.
- #
- # By default this script does nothing.
- # Print the IP address
- _IP=$(hostname -I) || true
- if [ "$_IP" ]; then
- printf "My IP address is %s\n" "$_IP"
- fi
- # SLB
- exec >/tmp/rc.local-output 2>&1; set -x
- nodejs /var/www/nstats/cpuinfo.js &
- #znc
- #route add default gw 192.168.1.1 wlan0
- ifdown eth0 && sleep 1 && ifup eth0 &
- # SLB
- #RPiCameraBrowser
- echo "SLB 1"
- sleep 1
- shopt -s nullglob
- video=-1
- for f in /var/www/media/video_*.mp4; do
- video=`echo $f | cut -d '_' -f2 | cut -d '.' -f1`
- done
- video=`echo $video | sed 's/^0*//'`
- video=`expr $video + 1`
- image=-1
- for f in /var/www/media/image_*.jpg; do
- image=`echo $f | cut -d '_' -f2 | cut -d '.' -f1`
- done
- image=`echo $image | sed 's/^0*//'`
- image=`expr $image + 1`
- shopt -u nullglob
- echo "SLB 2"
- sleep 1
- mkdir -p /dev/shm/mjpeg
- /usr/bin/raspimjpeg -fp -w 512 -h 288 -wp 512 -hp 384 -d 1 -q 25 -of /dev/shm/mjpeg/cam.jpg -cf /var/www/FIFO -sf /var/www/status_mjpeg.txt -vf /var/www/media/video_%04d_%04d%02d%02d_%02d%02d%02d.mp4 -if /var/www/media/image_%04d_%04d%02d%02d_%02d%02d%02d.jpg -p -ic $image -vc $video > /dev/null &
- #sleep 1
- #echo 'pm' > /var/www/FIFO
- #echo 'ro 90' > /var/www/FIFO
- #RPiCameraBrowser
- echo "SLB 3"
- exit 0
- --------------------------------------------
- cat /tmp/rc.local-output
- + echo 'SLB 1'
- SLB 1
- + sleep 1
- + ifdown eth0
- + nodejs /var/www/nstats/cpuinfo.js
- + sleep 1
- + shopt -s nullglob
- + video=-1
- ++ echo -1
- ++ sed 's/^0*//'
- + video=-1
- ++ expr -1 + 1
- + video=0
- + ifup eth0
- cpuinfo @ 7010
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement