heussueh
09/02/2024, 3:54 PMublue-os/firstboot directory run any bash script that is there on the first boot or is it only for yafti.yml?
I wanted to make a firstboot script just to configure and download some things at the beginning and never run it again.Answer Overflow
09/02/2024, 3:54 PMgmpinder
09/02/2024, 4:08 PMheussueh
09/02/2024, 4:27 PMheussueh
09/02/2024, 4:40 PMheussueh
09/02/2024, 4:41 PMbash
# Check if the script has already run
if [[ ! -f "$FIRSTBOOT_FILE" ]]; then
echo "First boot detected. Running setup script..."
run_modules
# Create the file to indicate that the script has run
touch "$FIRSTBOOT_FILE"
# Generate and store the hash in the firstboot file
generate_hash
# Disable the systemd service after successful execution
echo "Disabling firstboot systemd service..."
sudo systemctl disable firstboot.service
else
echo "First boot script has already run. Nothing to do."
figmpinder
09/02/2024, 5:14 PMxyny
09/02/2024, 8:03 PMxyny
09/02/2024, 8:04 PM