Merge branch 'master' of code.ungleich.ch:ungleich-public/ungleich-tools

This commit is contained in:
Nico Schottelius 2021-07-28 16:32:58 +02:00
commit c1256d5827
4 changed files with 36 additions and 41 deletions

View file

@ -97,6 +97,7 @@ run_root rc-update add sshd
run_root rc-update add networking
run_root rc-update add hostname
run_root rc-update add sysctl
run_root rc-update add modules
run_root sed -i 's/root:!::0:::::/root:*::0:::::/' /etc/shadow
sudo tee "$rootfs_tmpdir/etc/network/interfaces" <<EOF

21
k8s/configure-k8s-vms.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/sh
# Nico Schottelius
# 2021-07-25
if [ $# -lt 1 ]; then
echo "$0 cdist-workdir list-of-ipv6-addresses-of-vms"
exit 1
fi
workdir=$1; shift
names=""
for vm in "$@"; do
# get name and remove trailing dot
name=$(dig +short -x $vm | sed 's/\.$//')
names="$names $name"
done
cd "${workdir}"
cdist config -vv -j6 -p30 ${names}

View file

@ -27,47 +27,19 @@ uci set mjpg-streamer.core.enabled=1
uci set mjpg-streamer.core.resolution="1920x1080"
uci delete mjpg-streamer.core.username
uci delete mjpg-streamer.core.password
if ! uci show firewall | grep "name='Allow-Camera'"; then
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-HTTP'
uci set firewall.@rule[-1].src='wan'
uci set firewall.@rule[-1].proto='tcp'
uci set firewall.@rule[-1].dest_port='8080'
uci set firewall.@rule[-1].target='ACCEPT'
fi
uci commit
/etc/init.d/mjpg-streamer restart
EOF
exit 0
# This is old code / when we used motion
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

View file

@ -2,8 +2,6 @@
# Nico Schottelius
# 2020-06-14
set -e
set -x
if [ $# -ne 2 ]; then
echo "$0 viwib-ip-address viwib-id"
@ -12,6 +10,9 @@ if [ $# -ne 2 ]; then
exit 1
fi
set -e
set -x
viwib_ip=$1; shift
id=$1; shift