From e5fc90391646ea35b06250a90ad3aa3c1c2516dc Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Thu, 3 Sep 2020 20:21:09 -0400 Subject: [PATCH] minor fixes and dns --- archlike-pxe | 2 +- debian-pxe-preseed | 2 +- wrt-init | 18 ++++++++++++++++++ wrt-setup | 20 ++------------------ wrt-setup-local | 28 ++++++++++++++++++++-------- 5 files changed, 42 insertions(+), 28 deletions(-) create mode 100755 wrt-init diff --git a/archlike-pxe b/archlike-pxe index 085679a..db05bf9 100755 --- a/archlike-pxe +++ b/archlike-pxe @@ -72,7 +72,7 @@ pushd $(dirname $sfs); md5sum ${sfs##*/} > airootfs.md5; popd # seems if you've done a pxe boot, mounted the nfs, # then shutdown, it's still busy. -ssh wrt "/etc/init.d/nfsd stop; \ +ssh cmc "/etc/init.d/nfsd stop; \ umount /run/archiso/bootmnt; \ umount /run/parabolaiso/bootmnt; \ rm -rf /mnt/usb/$idir" diff --git a/debian-pxe-preseed b/debian-pxe-preseed index 094294a..aaef9a6 100755 --- a/debian-pxe-preseed +++ b/debian-pxe-preseed @@ -29,7 +29,7 @@ e() { echo "$*"; "$@"; } mount_dir=$(mktemp -d) err-cleanup() { cd; umount -f $mount_dir; } -e mount -o users wrt:/mnt/usb $mount_dir +e mount -o users cmc:/mnt/usb $mount_dir cd $mount_dir diff --git a/wrt-init b/wrt-init new file mode 100755 index 0000000..ebfac9c --- /dev/null +++ b/wrt-init @@ -0,0 +1,18 @@ +#!/bin/sh +set -x +# librecmc 1.5.1 is missing nfs-kernel-server and screen +source /etc/os-release +if [ "$ID" == librecmc ] && [ "$VERSION" == v1.5.1-core ]; then + cat >/etc/opkg/customfeeds.conf <<'EOF' +src/gz openwrt_packages http://downloads.openwrt.org/releases/19.07.3/packages/mips_24kc/packages +fi +EOF +fi + +if ! opkg list-installed|grep bash; then + opkg update + opkg install bash +fi +export HOME_DOMAIN=$1 +shift +wrt-setup-local "$@" diff --git a/wrt-setup b/wrt-setup index c86a0d5..7d3416b 100755 --- a/wrt-setup +++ b/wrt-setup @@ -69,27 +69,11 @@ fi echo "$0: host=$h" cat ~/.ssh/home.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null -scp /a/work/libremanage/libremanage /a/bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin +scp /a/work/libremanage/libremanage /a/bin/fai/wrt-init /a/bin/fai/wrt-setup-local /a/bin/cedit/cedit $h:/usr/bin # relay is built for openwrt 18.06.2, r7676-cddd7b4c77 sudo scp /q/root/shadow/router /p/c/machine_specific/wrt/etc/dropbear/dropbear_rsa_host_key \ /a/opt/openwrt/source/bin/packages/mips_24kc/mypackages/relay_1.0-1_mips_24kc.ipk \ /p/router-secrets /p/c/machine_specific/wrt/etc/wg.{key,psk} $h: scp ../openwrtkeyring/usign/* $h:/etc/opkg/keys -ssh $h </etc/opkg/customfeeds.conf <<'EOF' -src/gz openwrt_packages http://downloads.openwrt.org/releases/19.07.3/packages/mips_24kc/packages -fi -EOF - -if ! opkg list-installed|grep bash; then - opkg update - opkg install bash -fi -export HOME_DOMAIN=$HOME_DOMAIN -wrt-setup-local $@ -EOFOUTER +ssh $h wrt-init $HOME_DOMAIN "$@" diff --git a/wrt-setup-local b/wrt-setup-local index 18b4b91..567a4a7 100755 --- a/wrt-setup-local +++ b/wrt-setup-local @@ -653,8 +653,9 @@ fi v cedit /etc/hosts <