scripts/void-init.sh
2024-08-23 07:27:43 +03:00
Ask

27 lines
541 B
Bash
Executable File

{51da0bdcf2d1b673b28ad220a1cb5d388a23bf33 true 541 void-init.sh 0xc001ead420}

#!/bin/bash
if [ -z "$USERNAME" ]; then
USERNAME="spirit"
fi
cp /usr/share/xbps.d/*-repository-*.conf /etc/xbps.d/
xbps-install -Suy xbps
xbps-install -uy
xbps-install -y base-system
xbps-remove -y base-voidstrap
xbps-reconfigure -fa
useradd -m -G wheel -s /bin/bash $USERNAME
sed -i 's/# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
xbps-install -y opendoas
bash -c "echo 'permit nopass $USERNAME as root' > /etc/doas.conf"
if [[ "$1" == "--wsl" ]]; then
cat <<EOF > /etc/wsl.conf
[user]
default=$USERNAME
EOF
fi