Files
os_prepare/prep.sh
Michał Kopeć dd0c42305a Initial commit
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2022-01-19 17:40:33 +01:00

42 lines
872 B
Bash
Executable File

#!/bin/bash
# A script to automate initial configuration of the Dasharo testing environment
OS=$(awk -F= '$1=="ID" { print $2 ;}' /etc/os-release)
source os/$OS/commands
echo "------> Operating system detected: $OS"
# Prepare OS before installing packages
prepare() {
echo "------> Preparing for installation"
$SYNC
$UPGRADE
}
# Install packages from repositories
install_packages() {
echo "------> Installing packages"
$INSTALL $(cat os/$OS/packages.list)
}
# Configure operating system
configure() {
echo "------> Configuring system"
# TODO: Place configs in filesystem
}
# Ask the user to reboot the system
reboot_prompt() {
echo -n "Reboot? [y]/n > "
read response
if [[ "$response" == "y" || "$response" == "" ]]; then
echo /sbin/reboot
else
echo "Please reboot manually to finalize setup"
fi
}
prepare
#install_packages
configure
reboot_prompt