X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=arch-iso-init;fp=arch-iso-init;h=e0118f220cd4275e80406f7d824368b2c3b12b98;hb=1a5548031efc4a1fa88ca94237eac3033cf97ef1;hp=0000000000000000000000000000000000000000;hpb=da12892acf1eda37539938f2dd726f815b377e7a;p=automated-distro-installer diff --git a/arch-iso-init b/arch-iso-init new file mode 100644 index 0000000..e0118f2 --- /dev/null +++ b/arch-iso-init @@ -0,0 +1,18 @@ +#!/bin/bash +echo $(date) > /tmp/myarchinit.log +if ! ip a | grep '^ *inet ' | grep -vF 127.0.0.1; then + cat <<'eof' +We don't have an ipv4 address. Maybe arch doesn't do that for us, +or we are probably using an ethernet port +which is not the 1st one, so we haven't automatically done dhcpcd, +so let's do it on whatever interface has a carrier +eof + for f in /sys/class/net/*; do + if [[ `cat $f/carrier` == 1 ]]; then + echo $0: running: dhcpcd ${f##*/} + dhcpcd ${f##*/} + break + fi + done +fi +systemctl start sshd