Browse Source

Added version 0.1 (alpha) of the Pyrenee Conversion Utility

main
Chris Druif 2 years ago
parent
commit
ee6d64cb73
  1. 49
      pyrenee-conversion-utility.sh

49
pyrenee-conversion-utility.sh

@ -0,0 +1,49 @@
#! /bin/bash
#dialog that explains what will happen & create $USER, with option to cancel
TITLE="Pyrenee Conversion Utility"
dialog --colors --backtitle "\Z7$TITLE" --title "WELCOME!" --yes-label "OK" --msgbox "Welcome to the Pyrenee Conversion Utility.\n\nThis utility will make a number of (mostly reversible) changes to your system. It should be run directly after installing Alpine Linux, which will setup the foundation we build upon." 10 50
dialog --colors --backtitle "\Z7$TITLE" --title "Confirmation" --yes-label "Enter" --no-label "Esc" --yesno "Please press <Enter> to start conversion or <Esc> to cancel." 10 50
# Return status of non-zero indicates cancel
if [ "$?" != "0" ]
then
dialog --colors --backtitle "\Z7$TITLE" --msgbox "Pyrenee Conversion was canceled at your request." 10 50
else
dialog --colors --backtitle "\Z7$TITLE" --form "Please supply the required information:\n(username can only contain small letters)" 10 50 3 "Full Name:" 1 0 "" 1 10 15 0 "Username:" 2 0 "" 2 10 15 0 2>input && FULLNAME=$(sed -n '1p' input) && USER=$(sed -n '2p' input | sed 's/[A-Z]/\L&/g') && rm -f input
dialog --colors --insecure --backtitle "\Z7$TITLE" --title "Password Provider" --passwordbox "Provide a password for $FULLNAME" 10 50 2>password && PASSWORD=$(sed -n '1p' password) && rm -f password
adduser -g "$FULLNAME" $USER
$PASSWORD
$PASSWORD
cp /etc/apk/repositories /etc/apk/repositories.bak
sed -i s/http/https /etc/apk/repositories
cp /etc/default/useradd /etc/default/useradd.bak
sed -i s/ash/bash /etc/default/useradd
echo -e '#! /bin/bash\n\nalias sudo="doas"\nalias rm="rm -i"' > /etc/profile.d/aliases.sh
apk upgrade --available
setup-xorg-base
apk add doas htop nano falkon flatpak plasma kde-applications-base kde-applications-accessibility
cp /etc/doas.d/doas.conf /etc/doas.d/doas.conf.bak
echo -e "permit :wheel\npermit persist :wheel" >> /etc/doas.d/doas.conf
rc-update add sddm
rc-service sddm start
adduser $USER wheel
su $USER
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flatseal
fi
dialog --colors --backtitle "\Z7$TITLE" --title "Finished!" --yes-label "Enter" --no-label "Esc" --yesno "Conversion was completed, it is recommended to reboot to enter your new Desktop experience!\n\nPlease press <Enter> to reboot or <Esc> to continue your current session." 10 50
# Return status of non-zero indicates cancel
if [ "$?" != "0" ]
then
clear
else
doas reboot now
fi
Loading…
Cancel
Save