X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=wrt-setup;h=1e0d6362befbc4d56a9d1352cbf901f632cb0538;hp=42c41276edaca12797746a3fbb69c6c4b1852029;hb=6ca069946c8ff88d79d1ae421e0eda60ae1c514c;hpb=b5682902b6dce0a3d799e129877c8b43c4509774 diff --git a/wrt-setup b/wrt-setup index 42c4127..1e0d636 100755 --- a/wrt-setup +++ b/wrt-setup @@ -19,6 +19,8 @@ set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR +[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" + x="$(readlink -f "$BASH_SOURCE")"; cd ${x%/*} usage() { @@ -66,16 +68,16 @@ if [[ ! $h ]]; then esac fi -echo "$0: host=$h" - -cat ~/.ssh/home.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null +echo "$0: h=$h" +# todo: ecdsa key not working with dropbear +cat ~/.ssh/{h,hrsa,home}.pub | ssh $h dd of=/etc/dropbear/authorized_keys 2>/dev/null 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 #/a/opt/openwrt/source/bin/packages/mips_24kc/mypackages/relay_1.0-1_mips_24kc.ipk \ -sudo scp /q/root/shadow/router /p/c/machine_specific/wrt/etc/dropbear/dropbear_rsa_host_key \ +scp /q/root/shadow/router /p/c/machine_specific/wrt/etc/dropbear/dropbear_rsa_host_key \ /p/router-secrets /p/c/machine_specific/wrt/etc/wg.{key,psk} $h: scp ../openwrtkeyring/usign/* $h:/etc/opkg/keys -ssh $h wrt-init $HOME_DOMAIN "$@" +ssh $h wrt-init ${HOME_DOMAIN:-b8.nz} "$@"