#!/usr/bin/env bash # config.sh - Configuration and argument handling for archangel installer # Source this file after common.sh ############################# # Global Config Variables ############################# CONFIG_FILE="" UNATTENDED=false # These get populated by config file or interactive prompts HOSTNAME="" TIMEZONE="" LOCALE="" KEYMAP="" SELECTED_DISKS=() RAID_LEVEL="" WIFI_SSID="" WIFI_PASSWORD="" ENCRYPTION_ENABLED=false ZFS_PASSPHRASE="" ROOT_PASSWORD="" SSH_ENABLED=false SSH_KEY="" ############################# # Argument Parsing ############################# parse_args() { while [[ $# -gt 0 ]]; do case "$1" in --config-file) if [[ -n "$2" && ! "$2" =~ ^- ]]; then CONFIG_FILE="$2" shift 2 else error "--config-file requires a path argument" fi ;; --help|-h) show_usage exit 0 ;; *) error "Unknown option: $1 (use --help for usage)" ;; esac done } show_usage() { cat <