#!/bin/bash

# post installation steps for instantOS on first boot or upgrade

if ! whoami | grep -q root; then
    echo "please run this as root, thank you"
    exit 1
fi

echo "finishing up installation"
bash /root/instantARCH/postinstall.sh
bash /usr/share/instantdotfiles/rootinstall.sh

# delete credentials
[ -e /root/instantARCH/config/user ] && rm /root/instantARCH/config/user
[ -e /root/instantARCH/config/password ] && rm /root/instantARCH/config/password

if command -v systemctl; then
    systemctl disable instantpostinstall
    echo "entering sleep cycle, press ctrl + c to cancel"
    while :; do
        sleep 10000m
    done
fi
