pkgs/openwrt: switch sshScript to installing the image
This commit is contained in:
parent
1a6e0ec7a3
commit
bc764e2526
|
@ -11,25 +11,20 @@ let
|
||||||
"kmod-ath10k" "ath10k-firmware-qca988x"
|
"kmod-ath10k" "ath10k-firmware-qca988x"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in rec {
|
||||||
{
|
sshScript = hostName:
|
||||||
sshScript = hostName: ''
|
let
|
||||||
|
address = config.site.net.mgmt.hosts4.${hostName};
|
||||||
|
in ''
|
||||||
#! ${pkgs.runtimeShell} -e
|
#! ${pkgs.runtimeShell} -e
|
||||||
|
|
||||||
${if config.site.hosts.${hostName}.firstboot
|
ssh root@${address} "cat > /tmp/openwrt-image" < ${buildImage hostName}/openwrt-*-${hostName}-*-sysupgrade.bin
|
||||||
then ''
|
ssh root@${address} "sysupgrade -n /tmp/openwrt-image"
|
||||||
ssh-keygen -R 192.168.1.1
|
|
||||||
ssh root@192.168.1.1 \
|
|
||||||
"ash -e -x" <<__SSH__
|
|
||||||
'' else ''
|
|
||||||
ssh root@${config.site.net.mgmt.hosts4.${hostName}} \
|
|
||||||
"ash -e -x" <<__SSH__
|
|
||||||
${uciConfig hostName}
|
|
||||||
__SSH__
|
|
||||||
|
|
||||||
echo "Base configuration done \\o/"
|
# ssh hostkey will have changed after boot
|
||||||
echo "Later run: ap_install_collectd.sh ${config.site.net.mgmt.hosts4.${hostName}}"
|
ssh-keygen -R ${address}
|
||||||
''}
|
|
||||||
|
/run/wrappers/bin/ping ${address}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildImage = hostName:
|
buildImage = hostName:
|
||||||
|
|
Loading…
Reference in New Issue