X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=archlike-iso-init;fp=archlike-iso-init;h=25b9f86c51910dfcd12022e525d1b2bdce13cc38;hb=0d7f79362d601b278236cd1c533c7333e342b54a;hp=0000000000000000000000000000000000000000;hpb=15da839e14b07b30de9c3f7559bd17213e4f193d;p=automated-distro-installer diff --git a/archlike-iso-init b/archlike-iso-init new file mode 100644 index 0000000..25b9f86 --- /dev/null +++ b/archlike-iso-init @@ -0,0 +1,18 @@ +#!/bin/bash +echo $(date) > /tmp/myarchlikeinit.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