Add post install script chaining
This commit is contained in:
parent
2bf4f8e814
commit
b5f7d77488
27
install.sh
27
install.sh
@ -33,6 +33,7 @@ ultra_quiet() {
|
|||||||
### URLs ###
|
### URLs ###
|
||||||
FZF_DOWNLOAD="$(curl -s https://api.github.com/repos/junegunn/fzf/releases/latest | grep linux_amd64 | sed -nE 's/^\s*"browser_download_url":\s*"(.*)"\s*$/\1/p')"
|
FZF_DOWNLOAD="$(curl -s https://api.github.com/repos/junegunn/fzf/releases/latest | grep linux_amd64 | sed -nE 's/^\s*"browser_download_url":\s*"(.*)"\s*$/\1/p')"
|
||||||
PARTED_DOWNLOAD="https://archlinux.org/packages/extra/x86_64/parted/download"
|
PARTED_DOWNLOAD="https://archlinux.org/packages/extra/x86_64/parted/download"
|
||||||
|
POST_INSTALL_SCRIPT="https://raw.githubusercontent.com/augustogunsch/install-arch/master/post-install.sh"
|
||||||
|
|
||||||
### COLORS ###
|
### COLORS ###
|
||||||
RED='\033[0;31m'
|
RED='\033[0;31m'
|
||||||
@ -251,10 +252,14 @@ setup_network() {
|
|||||||
|
|
||||||
ask_password() {
|
ask_password() {
|
||||||
echo -n "Type password for $1: "
|
echo -n "Type password for $1: "
|
||||||
|
stty -echo
|
||||||
read USER_PASSWORD
|
read USER_PASSWORD
|
||||||
|
stty echo
|
||||||
echo -n "Confirm password: "
|
echo -n "Confirm password: "
|
||||||
|
stty -echo
|
||||||
local PASSWORD_CONFIRM
|
local PASSWORD_CONFIRM
|
||||||
read PASSWORD_CONFIRM
|
read PASSWORD_CONFIRM
|
||||||
|
stty echo
|
||||||
if [ "$USER_PASSWORD" != "$PASSWORD_CONFIRM" ]; then
|
if [ "$USER_PASSWORD" != "$PASSWORD_CONFIRM" ]; then
|
||||||
echo "Wrong passwords. Please try again."
|
echo "Wrong passwords. Please try again."
|
||||||
ask_password $1
|
ask_password $1
|
||||||
@ -272,7 +277,7 @@ prompt_all() {
|
|||||||
qpopd
|
qpopd
|
||||||
|
|
||||||
echo "Choose locale:"
|
echo "Choose locale:"
|
||||||
local LOCALE=$(cat /etc/locale.gen | sed '/^#\s/D' | sed '/^#$/D' | sed 's/^#//' | fzf --layout=reverse --height=20)
|
LOCALE=$(cat /etc/locale.gen | sed '/^#\s/D' | sed '/^#$/D' | sed 's/^#//' | fzf --layout=reverse --height=20)
|
||||||
|
|
||||||
ask_password root
|
ask_password root
|
||||||
ROOT_PASSWORD="$USER_PASSWORD"
|
ROOT_PASSWORD="$USER_PASSWORD"
|
||||||
@ -286,6 +291,15 @@ prompt_all() {
|
|||||||
read MACHINE_HOSTNAME
|
read MACHINE_HOSTNAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
curl -sL "$POST_INSTALL_SCRIPT" -o post-install.sh
|
||||||
|
mv post-install /mnt/root
|
||||||
|
chmod +x /mnt/root
|
||||||
|
echo -n "Ready for post-install script. Press any key to continue..."
|
||||||
|
read dummy
|
||||||
|
right_chroot /root/post-install.sh
|
||||||
|
}
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
print_phase "System configuration"
|
print_phase "System configuration"
|
||||||
|
|
||||||
@ -294,11 +308,6 @@ configure() {
|
|||||||
setup_grub
|
setup_grub
|
||||||
setup_users
|
setup_users
|
||||||
setup_network
|
setup_network
|
||||||
|
|
||||||
umount -R /mnt
|
|
||||||
echo -n "Ready to reboot. Press any key to continue..."
|
|
||||||
read dummy
|
|
||||||
reboot
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
@ -306,6 +315,12 @@ main() {
|
|||||||
partition
|
partition
|
||||||
install_base
|
install_base
|
||||||
configure
|
configure
|
||||||
|
post_install
|
||||||
|
|
||||||
|
umount -R /mnt
|
||||||
|
echo -n "Ready to reboot. Press any key to continue..."
|
||||||
|
read dummy
|
||||||
|
reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
@ -432,7 +432,8 @@ install_packages() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
#install_packages
|
#install_packages
|
||||||
configure_doas
|
#configure_doas
|
||||||
|
echo "POST INSTALL TEST"
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
Loading…
x
Reference in New Issue
Block a user