++openwrt scripts
This commit is contained in:
parent
f89a6a3dbb
commit
970370c198
3 changed files with 84 additions and 0 deletions
52
openwrt-add-camera-with-motion.sh
Executable file
52
openwrt-add-camera-with-motion.sh
Executable file
|
@ -0,0 +1,52 @@
|
|||
#!/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 <<COF
|
||||
|
||||
ipv6_enabled on
|
||||
daemon off
|
||||
process_id_file /var/run/motion/motion.pid
|
||||
setup_mode off
|
||||
|
||||
webcontrol_port 8080
|
||||
webcontrol_localhost on
|
||||
|
||||
videodevice /dev/video0
|
||||
v4l2_palette 8
|
||||
|
||||
width 1280
|
||||
height 720
|
||||
|
||||
videodevice /dev/video0
|
||||
input -1
|
||||
stream_port 8081
|
||||
stream_localhost off
|
||||
|
||||
COF
|
||||
|
||||
/etc/init.d/motion restart
|
||||
EOF
|
32
openwrt-add-jool.sh
Normal file
32
openwrt-add-jool.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$0 ip-address nat64-prefix"
|
||||
echo " ip-address: where to find the OpenWRT device"
|
||||
echo " nat64-prefix: which network to use for outgoing 'ipv4' (f.i. 2a0a:e5c0:2:10::/96)"
|
||||
echo " ip-address: where to find the OpenWRT device"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
my_ip=$1; shift
|
||||
nat64_prefix=$1; shift
|
||||
|
||||
cat <<EOF | ssh -t "root@${my_ip}"
|
||||
set -x
|
||||
|
||||
opkg update
|
||||
opkg install kmod-jool jool-tools
|
||||
|
||||
# Depending on the interface
|
||||
sysctl -w net.ipv6.conf.wlan0.accept_ra=2
|
||||
|
||||
modprobe jool_siit
|
||||
jool_siit -6 2a0a:e5c0:2:10::/96
|
||||
jool_siit -e -a 2a0a:e5c0:10:b01::/64 192.168.1.0/24
|
||||
|
||||
|
||||
|
||||
#jool_siit -e -a 2a0a:e5c1:14d:f00d::/96 10.0.0.0/8
|
||||
|
||||
|
||||
EOF
|
Loading…
Reference in a new issue