Magic dock0 thing

by akerl-prepaid
253 deployments · 4 still active · last rev. 2 years ago

Magic dock0 Creator

Compatible with: No distros currently supported
						#!/usr/bin/env bash
#<udf name="name" label="Hostname">
#<udf name="debug" label="Debug Mode">

sed -i 's|/sbin/agetty|/sbin/agetty --autologin root|' /usr/lib/systemd/system/serial-getty\@.service
systemctl --system daemon-reload

if [[ "$DEBUG" == '1' ]] ; then
    echo 'Debug mode enabled'
    touch /tmp/debug_mode
fi

cat <<EOF > /root/kickstart
systemctl start haveged

if [ ! -d /etc/pacman.d/gnupg ] ; then
    pacman-key --init
    pacman-key --populate
fi

pacman -Syu --noconfirm
pacman -Syu --noconfirm git ruby arch-install-scripts python python-pip base-devel bc squashfs-tools mkinitcpio btrfs-progs

gem install --no-user-install dock0

git clone --recursive git://github.com/dock0/host_config /opt/host_config

echo "" > /proc/sys/kernel/hotplug

dock0 /opt/host_config/config.yaml /opt/host_config/configs/$NAME.yaml && shutdown
EOF
chmod a+x /root/kickstart

echo 'rm .profile && exec /root/kickstart' > /root/.profile

echo 'Done kickstarting!'