#!/bin/sh PARAMS=$(> /root/.ssh/authorized_keys fi # Inject certs if [[ $PARAMS =~ tls.enabled=(true|True) ]]; then cp /etc/ironic-python-agent.d/ca-certs/* /etc/pki/trust/anchors/ cp /etc/ironic-python-agent.d/ca-certs/* /usr/share/pki/trust/anchors/ update-ca-certificates fi # autologin root on given console (default tty1) if suse.autologin or coreos.autologin is enabled if [[ $PARAMS =~ (suse|coreos)\.autologin=?([^ ]*) ]]; then tty="${BASH_REMATCH[2]:-tty1}" echo "Enabling autologin on $tty..." systemctl stop getty@$tty systemctl disable getty@$tty systemctl start autologin@$tty fi # Append to /etc/hosts # hosts.append=1.2.3.4_foo,4.5.6.7_foo2 if [[ $PARAMS =~ hosts.append=([^ ]+) ]]; then HOSTS=${BASH_REMATCH[1]} echo "Appending to hosts ${HOSTS}..." for h in ${HOSTS/,/ }; do echo "${h/_/ }" >> /etc/hosts done cat /etc/hosts fi