removed logging and fixed colors

This commit is contained in:
[yuri]
2025-11-10 15:16:05 +01:00
parent af8f6078cf
commit aa7f8e97d0
9 changed files with 14 additions and 69 deletions

View File

@@ -22,22 +22,14 @@ fi
color_yellow() { printf '%b' "$YELLOW"; }
color_cyan() { printf '%b' "$CYAN"; }
color_red() { printf '%b' "$RED"; }
color_green() { printf '%b' "$GREEN"; }
color_reset() { printf '%b' "$RESET"; }
##########################
# Optional logging setup
##########################
LOG_DIR="./logs"
LOG_FILE="$LOG_DIR/setup.log"
mkdir -p "$LOG_DIR"
exec > >(tee -a "$LOG_FILE") 2>&1
##########################
# Script Version Selection
##########################
SCRIPT_VERSION="${SCRIPT_VERSION:-v1}" # Default to v1 if not set
# Optional: ask user which version to use (uncomment if you want interactivity)
echo
echo "Select script version:"
echo " 1) v1 (legacy)"
@@ -46,7 +38,6 @@ read -rp "Enter choice [1/2] (default: 2): " ver_choice
case "$ver_choice" in
1) SCRIPT_VERSION="v1" ;;
*) SCRIPT_VERSION="v2" ;;
esac
echo
@@ -63,6 +54,9 @@ if [[ ! -d "./${SCRIPT_VERSION}" ]]; then
exit 1
fi
##########################
# OS Detection
##########################
echo
color_yellow
echo "################################################################"
@@ -71,9 +65,6 @@ echo "################################################################"
color_reset
echo
##########################
# OS Detection
##########################
source /etc/os-release
OS_ID="${ID,,}"
@@ -217,7 +208,6 @@ color_reset
echo
INSTALL_LEVEL="minimal" # default
while true; do
echo
echo "Select installation level:"
@@ -252,7 +242,7 @@ export SELECTED_TWM="$TWM"
export INSTALL_LEVEL
##########################
# Determine OS script (with version)
# Determine OS script
##########################
case "$OS" in
debian) OS_SCRIPT="./${SCRIPT_VERSION}/debian.sh" ;;
@@ -269,7 +259,7 @@ case "$OS" in
esac
##########################
# Preflight check
# Preflight check & run
##########################
if [[ ! -f "$OS_SCRIPT" ]]; then
color_red
@@ -280,13 +270,9 @@ if [[ ! -f "$OS_SCRIPT" ]]; then
fi
if [[ ! -x "$OS_SCRIPT" ]]; then
echo "Fixing permissions on $OS_SCRIPT..."
chmod +x "$OS_SCRIPT"
fi
##########################
# Run OS script (always via Bash)
##########################
echo
color_cyan
echo "Running OS script: $OS_SCRIPT"
@@ -305,5 +291,3 @@ echo "################################################################"
echo "End Detection"
echo "################################################################"
color_reset
echo
echo "Logs saved to: $LOG_FILE"