diff --git a/ceph-host-move-to-root b/ceph/ceph-host-move-to-root similarity index 100% rename from ceph-host-move-to-root rename to ceph/ceph-host-move-to-root diff --git a/ceph-keyring-create-initial b/ceph/ceph-keyring-create-initial similarity index 100% rename from ceph-keyring-create-initial rename to ceph/ceph-keyring-create-initial diff --git a/ceph-mgr-create-start b/ceph/ceph-mgr-create-start similarity index 100% rename from ceph-mgr-create-start rename to ceph/ceph-mgr-create-start diff --git a/ceph-mgr-stop-delete b/ceph/ceph-mgr-stop-delete similarity index 100% rename from ceph-mgr-stop-delete rename to ceph/ceph-mgr-stop-delete diff --git a/ceph-mon-create-start b/ceph/ceph-mon-create-start similarity index 100% rename from ceph-mon-create-start rename to ceph/ceph-mon-create-start diff --git a/ceph-mon-stop-delete b/ceph/ceph-mon-stop-delete similarity index 100% rename from ceph-mon-stop-delete rename to ceph/ceph-mon-stop-delete diff --git a/ceph-osd-activate b/ceph/ceph-osd-activate similarity index 100% rename from ceph-osd-activate rename to ceph/ceph-osd-activate diff --git a/ceph-osd-activate-all b/ceph/ceph-osd-activate-all similarity index 100% rename from ceph-osd-activate-all rename to ceph/ceph-osd-activate-all diff --git a/ceph-osd-class-remove b/ceph/ceph-osd-class-remove similarity index 100% rename from ceph-osd-class-remove rename to ceph/ceph-osd-class-remove diff --git a/ceph-osd-class-set b/ceph/ceph-osd-class-set similarity index 100% rename from ceph-osd-class-set rename to ceph/ceph-osd-class-set diff --git a/ceph-osd-create-on-all-disks b/ceph/ceph-osd-create-on-all-disks similarity index 100% rename from ceph-osd-create-on-all-disks rename to ceph/ceph-osd-create-on-all-disks diff --git a/ceph-osd-create-start b/ceph/ceph-osd-create-start similarity index 100% rename from ceph-osd-create-start rename to ceph/ceph-osd-create-start diff --git a/ceph-osd-create-start-alpine b/ceph/ceph-osd-create-start-alpine similarity index 100% rename from ceph-osd-create-start-alpine rename to ceph/ceph-osd-create-start-alpine diff --git a/ceph-osd-stop-disable b/ceph/ceph-osd-stop-disable similarity index 100% rename from ceph-osd-stop-disable rename to ceph/ceph-osd-stop-disable diff --git a/ceph-osd-stop-remove-permanently b/ceph/ceph-osd-stop-remove-permanently similarity index 100% rename from ceph-osd-stop-remove-permanently rename to ceph/ceph-osd-stop-remove-permanently diff --git a/ceph-pool-create b/ceph/ceph-pool-create similarity index 100% rename from ceph-pool-create rename to ceph/ceph-pool-create diff --git a/ceph-upgrade-server-to-nautilus.sh b/ceph/ceph-upgrade-server-to-nautilus.sh similarity index 100% rename from ceph-upgrade-server-to-nautilus.sh rename to ceph/ceph-upgrade-server-to-nautilus.sh diff --git a/mikrotik-configure-crs326-dumb.sh b/mikrotik/mikrotik-configure-crs326-dumb.sh similarity index 100% rename from mikrotik-configure-crs326-dumb.sh rename to mikrotik/mikrotik-configure-crs326-dumb.sh diff --git a/mikrotik-configure-crs326-with-vlans.sh b/mikrotik/mikrotik-configure-crs326-with-vlans.sh similarity index 100% rename from mikrotik-configure-crs326-with-vlans.sh rename to mikrotik/mikrotik-configure-crs326-with-vlans.sh diff --git a/mikrotik-configure-crs326.sh b/mikrotik/mikrotik-configure-crs326.sh similarity index 100% rename from mikrotik-configure-crs326.sh rename to mikrotik/mikrotik-configure-crs326.sh diff --git a/mikrotik-setup.sh b/mikrotik/mikrotik-setup.sh similarity index 100% rename from mikrotik-setup.sh rename to mikrotik/mikrotik-setup.sh diff --git a/mikrotik-update.sh b/mikrotik/mikrotik-update.sh similarity index 100% rename from mikrotik-update.sh rename to mikrotik/mikrotik-update.sh diff --git a/mystrom-off.sh b/mystrom/mystrom-off.sh similarity index 100% rename from mystrom-off.sh rename to mystrom/mystrom-off.sh diff --git a/mystrom-on.sh b/mystrom/mystrom-on.sh similarity index 100% rename from mystrom-on.sh rename to mystrom/mystrom-on.sh diff --git a/mystrom-status.sh b/mystrom/mystrom-status.sh similarity index 100% rename from mystrom-status.sh rename to mystrom/mystrom-status.sh diff --git a/mystrom-temperature.sh b/mystrom/mystrom-temperature.sh similarity index 100% rename from mystrom-temperature.sh rename to mystrom/mystrom-temperature.sh diff --git a/mystrom-toggle.sh b/mystrom/mystrom-toggle.sh similarity index 100% rename from mystrom-toggle.sh rename to mystrom/mystrom-toggle.sh diff --git a/openwrt-add-camera-with-mjpg-streamer.sh b/openwrt/openwrt-add-camera-with-mjpg-streamer.sh similarity index 100% rename from openwrt-add-camera-with-mjpg-streamer.sh rename to openwrt/openwrt-add-camera-with-mjpg-streamer.sh diff --git a/openwrt-add-camera-with-motion.sh b/openwrt/openwrt-add-camera-with-motion.sh similarity index 100% rename from openwrt-add-camera-with-motion.sh rename to openwrt/openwrt-add-camera-with-motion.sh diff --git a/openwrt-add-gps.sh b/openwrt/openwrt-add-gps.sh similarity index 100% rename from openwrt-add-gps.sh rename to openwrt/openwrt-add-gps.sh diff --git a/openwrt-add-jool.sh b/openwrt/openwrt-add-jool.sh similarity index 100% rename from openwrt-add-jool.sh rename to openwrt/openwrt-add-jool.sh diff --git a/openwrt-add-letsencrypt.sh b/openwrt/openwrt-add-letsencrypt.sh similarity index 100% rename from openwrt-add-letsencrypt.sh rename to openwrt/openwrt-add-letsencrypt.sh diff --git a/openwrt-add-qmi-lte.sh b/openwrt/openwrt-add-qmi-lte.sh similarity index 100% rename from openwrt-add-qmi-lte.sh rename to openwrt/openwrt-add-qmi-lte.sh diff --git a/openwrt-add-temper.sh b/openwrt/openwrt-add-temper.sh similarity index 100% rename from openwrt-add-temper.sh rename to openwrt/openwrt-add-temper.sh diff --git a/openwrt-add-usb-lte.sh b/openwrt/openwrt-add-usb-lte.sh similarity index 100% rename from openwrt-add-usb-lte.sh rename to openwrt/openwrt-add-usb-lte.sh diff --git a/openwrt-add-wireguard.sh b/openwrt/openwrt-add-wireguard.sh similarity index 100% rename from openwrt-add-wireguard.sh rename to openwrt/openwrt-add-wireguard.sh diff --git a/openwrt-hp-250-g5-add-wifi.sh b/openwrt/openwrt-hp-250-g5-add-wifi.sh similarity index 100% rename from openwrt-hp-250-g5-add-wifi.sh rename to openwrt/openwrt-hp-250-g5-add-wifi.sh diff --git a/openwrt-motion-config.sh b/openwrt/openwrt-motion-config.sh similarity index 100% rename from openwrt-motion-config.sh rename to openwrt/openwrt-motion-config.sh diff --git a/viirb-1-connect-flash-latest-openwrt.sh b/openwrt/viirb-1-firmware-upgrade.sh similarity index 100% rename from viirb-1-connect-flash-latest-openwrt.sh rename to openwrt/viirb-1-firmware-upgrade.sh diff --git a/viirb-2-configure-fully-after-upgrade.sh b/openwrt/viirb-2-configure.sh similarity index 100% rename from viirb-2-configure-fully-after-upgrade.sh rename to openwrt/viirb-2-configure.sh diff --git a/viirb-3-vpn.sh b/openwrt/viirb-3-vpn.sh similarity index 100% rename from viirb-3-vpn.sh rename to openwrt/viirb-3-vpn.sh diff --git a/viirb-4-cleanup-final-stage.sh b/openwrt/viirb-4-cleanup-final-stage.sh similarity index 100% rename from viirb-4-cleanup-final-stage.sh rename to openwrt/viirb-4-cleanup-final-stage.sh diff --git a/viirb-get-openwrt-firmware.sh b/openwrt/viirb-get-openwrt-firmware.sh similarity index 100% rename from viirb-get-openwrt-firmware.sh rename to openwrt/viirb-get-openwrt-firmware.sh diff --git a/viirb1-2-together.sh b/openwrt/viirb1-2-together.sh similarity index 100% rename from viirb1-2-together.sh rename to openwrt/viirb1-2-together.sh diff --git a/viwib-1-firmware-upgrade.sh b/openwrt/viwib-1-firmware-upgrade.sh similarity index 100% rename from viwib-1-firmware-upgrade.sh rename to openwrt/viwib-1-firmware-upgrade.sh diff --git a/openwrt/viwib-2-configure.sh b/openwrt/viwib-2-configure.sh new file mode 100755 index 0000000..bff5f03 --- /dev/null +++ b/openwrt/viwib-2-configure.sh @@ -0,0 +1,225 @@ +#!/bin/sh +# 2020-06-13, Nico Schottelius +# See https://ungleich.ch/u/products/viwib-wifi-ipv6-box/ + +if [ $# -lt 2 ]; then + echo "$0 viwib-ip-address viwib-id [wgprivkey]" + echo " viwib-ip-address: where to find the viwib" + echo " viwib-id: number in decimal format" + echo " wgprivkey: if specified, use this private key" + exit 1 +fi + + +set -x +viwib_ip=$1; shift +id=$1; shift +hex_id=$(printf "%0.2x\n" "$id") +viwib_hostname=viwib${id} + +prefix_base=2a0a:e5c1:3 +my_prefix=${prefix_base}${hex_id} +my_network=${my_prefix}::/48 + +my_wireguard_ip=${my_prefix}::42 +my_lan_ip=${my_prefix}:cafe::42 +my_wifi_ip=${my_prefix}:7ea::42 + +# wireguard +if [ $# -eq 1 ]; then + private_key=$1; shift +else + private_key=$(wg genkey) +fi +public_key=$(echo $private_key | wg pubkey) + +vpn_endpoint_host=vpn-2a0ae5c1300.ungleich.ch +vpn_endpoint_pubkey=ft68G2RID7gZ6PXjFCSCOdJ9yspRg+tUw0YrNK9cTxE= + +ping -c3 ${viwib_ip} +if [ $? -ne 0 ]; then + echo "Cannot reach ${viwib_ip}, aborting" + exit 1 +fi + +cat < ${viwib_hostname}.public_key diff --git a/viwib-3-vpn.sh b/openwrt/viwib-3-vpn.sh similarity index 100% rename from viwib-3-vpn.sh rename to openwrt/viwib-3-vpn.sh