LXD to incus for vps setup script

This commit is contained in:
Dionysus 2024-06-06 13:11:10 -04:00
parent 5c2f8c51a7
commit 32ad0f1b81
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE

View File

@ -44,7 +44,7 @@ setup_chroot() {
xbps-install -u xbps
xbps-remove -y base-system openssh
xbps-install -Syu curl dropbear git htop lxd iptables nano net-tools runit-iptables tmux socklog-void wget
xbps-install -Syu curl dropbear git htop incus incus-client incus-tools iptables nano net-tools runit-iptables tmux socklog-void wget
# Set up networking
IP_ADDR=$(ip addr show eth0 | grep 'inet ' | awk '{print $2}' | cut -d'/' -f1)
@ -77,7 +77,10 @@ setup_chroot() {
chsh -s /bin/bash
useradd -m -s /bin/bash $USERNAME && passwd $USERNAME
gpasswd -a $USERNAME lxd
gpasswd -a $USERNAME _incus
gpasswd -a $USERNAME _incus-admin
printf "root:1000000:65536\n$USERNAME:165536:65536" > /etc/subgid
printf "root:1000000:65536\n$USERNAME:165536:65536" > /etc/subuid
cp vps /home/$USERNAME/ && chown $USERNAME:$USERNAME /home/$USERNAME/vps
if [ ! $ARCH = 'x86_64-musl' ]; then
@ -91,52 +94,26 @@ setup_chroot() {
echo "proc /proc proc defaults,hidepid=2 0 0" >> /etc/fstab
mount -o remount /proc
# Preseed LXD initialization
{
echo "config:"
echo " images.auto_update_interval: \"0\""
echo "networks:"
echo "- config:"
echo " ipv4.address: auto"
echo " ipv6.address: none" # Do we need IPv6
echo " description: \"\""
echo " name: lxdbr0"
echo " type: \"\""
echo " project: default"
echo "storage_pools: []"
echo "profiles:"
echo "- config: {}"
echo " description: \"\""
echo " devices:"
echo " eth0:"
echo " name: eth0"
echo " network: lxdbr0"
echo " type: nic"
echo " name: default"
echo "projects: []"
echo "cluster: null"
} | lxd init --preseed
# Add the official SuperNETs seal of HARD FUCKIGN CORE INTERNET USAGE into the MOTD
{
echo ""
echo " \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo "\033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo "\033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo "┏┓┳┳┏┓┏┓┳┓ \033[37;104m \033[37;101m \033[37;104m \033[0m ┳┓┏┓┏┳┓┏┓"
echo "┗┓┃┃┣┛┣ ┣┫ \033[37;104m \033[0m ┃┃┣ ┃ ┗┓"
echo "┗┛┗┛┻ ┗┛┛┗ \033[37;104m \033[0m\033[0m ┛┗┗┛ ┻ ┗┛"
echo ""
echo -e ""
echo -e " \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e "\033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e "\033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;103m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e " \033[37;104m \033[37;101m \033[37;104m \033[0m \033[0m"
echo -e "┏┓┳┳┏┓┏┓┳┓ \033[37;104m \033[37;101m \033[37;104m \033[0m ┳┓┏┓┏┳┓┏┓"
echo -e "┗┓┃┃┣┛┣ ┣┫ \033[37;104m \033[0m ┃┃┣ ┃ ┗┓"
echo -e "┗┛┗┛┻ ┗┛┛┗ \033[37;104m \033[0m\033[0m ┛┗┗┛ ┻ ┗┛"
echo -e ""
} > /etc/motd
# Set up user SSH keys