From 96f0f94cfd4b0bd13058be8febba73c2b9443095 Mon Sep 17 00:00:00 2001 From: llnu Date: Wed, 11 Dec 2019 22:56:54 +0100 Subject: [PATCH] not working state --- debian-devuan-netboot.sh | 31 ++++++++++++++++++++++++++++--- magiccommand | 2 ++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100755 magiccommand diff --git a/debian-devuan-netboot.sh b/debian-devuan-netboot.sh index 9585709..799ee11 100755 --- a/debian-devuan-netboot.sh +++ b/debian-devuan-netboot.sh @@ -1,12 +1,16 @@ #!/bin/sh # Nico Schottelius, 2019-12-09 +# the ugly code is llnu + +#this can only run in the ungleich-tools directory because of the cat magiccommand........ if [ $# -ne 1 ]; then - echo $0 suite + echo $0 suite # rootpw echo suite is for instance ascii, beowulf, etc +# echo rootpw: set root password exit 1 fi - +#pw=$2 suite=$1; shift date=$(date +%F) @@ -16,7 +20,8 @@ kernel=${dir}-kernel keyurl=https://code.ungleich.ch/ungleich-public/__ungleich_staff_ssh_access/raw/master/files debootstrap "${suite}" "${dir}" -chroot ${dir} apt install -y openssh-server rdnssd linux-image-amd64 +chroot ${dir} apt install -y openssh-server rdnssd linux-image-amd64 # ; \ +# echo "root:${pw}" | chgpasswd cat > ${dir}/etc/network/interfaces << EOF auto lo @@ -26,6 +31,23 @@ auto eth0 iface eth0 inet6 auto EOF + +#set hostname +echo "unconfigured-host" > ${dir}/etc/hostname + + +#add script to display eth0's ip +# the pretty but ugly code and not working +#echo 'echo $(ip -o -6 addr show | grep -E -v "lo|one" | awk '{print $1" " $2": "$4}') >> /etc/issue' > ${dir}/etc/rc.local + +#the also not working +#echo '* * * * * root ip -o -6 addr show | grep -E -v "lo|one" > /etc/issue' > ${dir}/etc/cron.d/ipv6addr + +# +#echo '* * * * * root ' > ${dir}/etc/cron.d/ipv6addr +cp ./magiccommand ${dir}/etc/cron.d/ipv6addr + + mv ${dir}/boot/vmlinuz-* ${kernel} rm ${dir}/boot/initrd* mkdir -p ${dir}/root/.ssh @@ -40,3 +62,6 @@ done ln -s /sbin/init ${dir}/init ( cd ${dir} ; find . | cpio -H newc -o | gzip -9 > ../${dir}-initramfs ) + +# tried to clear history but doesnt work :/ +# history -c diff --git a/magiccommand b/magiccommand new file mode 100755 index 0000000..e724d8e --- /dev/null +++ b/magiccommand @@ -0,0 +1,2 @@ +* * * * * root ip -o -6 addr show | grep -E -v "lo |one" | awk '{print $1" " $2": "$4}' >> /dev/tty1 +