import new camera script

Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
Nico Schottelius 2020-10-26 11:52:49 +01:00
parent 812bf0a8fd
commit 9a7470d94a

View file

@ -1,11 +1,33 @@
#!/bin/sh
if [ $# -lt 1 ]; then
echo "$0 ip-address"
echo " ip-address: where to find the device"
exit 1
fi
set -x
openwrt_ip=$1; shift
ping -c3 ${openwrt_ip}
if [ $? -ne 0 ]; then
echo "Cannot reach ${openwrt_ip}, aborting"
exit 1
fi
cat <<EOF | ssh -t "root@${openwrt_ip}"
set -x
opkg update
opkg install motion kmod-video-uvc
uci set motion.general.enabled=1
cat > /etc/motion.conf <<EOF
cat > /etc/motion.conf <<COF
ipv6_enabled on
daemon off
process_id_file /var/run/motion/motion.pid
setup_mode off
@ -21,8 +43,10 @@ height 720
videodevice /dev/video0
input -1
text_left place7, Luchsingen
stream_port 8081
framerate 1
stream_localhost off
COF
/etc/init.d/motion restart
EOF