updated debian scripts
This commit is contained in:
@@ -1,44 +1,32 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
##########################
|
||||
# Color helpers (no tput)
|
||||
##########################
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'
|
||||
GRAY='\033[0;37m'
|
||||
BOLD='\033[1m'
|
||||
RESET='\033[0m'
|
||||
# Colors + logging same pattern
|
||||
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[0;33m'
|
||||
CYAN='\033[0;36m'; GRAY='\033[0;37m'; BOLD='\033[1m'; RESET='\033[0m'
|
||||
[ ! -t 1 ] && RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
|
||||
|
||||
# Disable colors if output is not a terminal
|
||||
if [ ! -t 1 ]; then
|
||||
RED='' GREEN='' YELLOW='' CYAN='' GRAY='' BOLD='' RESET=''
|
||||
fi
|
||||
|
||||
color_red() { printf '%b' "$RED"; }
|
||||
color_green() { printf '%b' "$GREEN"; }
|
||||
color_yellow() { printf '%b' "$YELLOW"; }
|
||||
color_cyan() { printf '%b' "$CYAN"; }
|
||||
color_gray() { printf '%b' "$GRAY"; }
|
||||
color_reset() { printf '%b' "$RESET"; }
|
||||
color_green() { printf '%b' "$GREEN"; }
|
||||
color_reset() { printf '%b' "$RESET"; }
|
||||
|
||||
LOGFILE="${LOGFILE:-/tmp/debian-server.log}"
|
||||
exec > >(tee -a "$LOGFILE") 2>&1
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
OS="${DETECTED_OS:-debian}"
|
||||
|
||||
##########################
|
||||
# Use exported variables from main detection script
|
||||
# Helper functions
|
||||
##########################
|
||||
OS="${DETECTED_OS}"
|
||||
DDE="${DETECTED_DE}"
|
||||
DE="${SELECTED_DE:-none}"
|
||||
TWM="${SELECTED_TWM:-none}"
|
||||
INSTALL_LEVEL="${INSTALL_LEVEL:-minimal}"
|
||||
install_packages() { sudo apt update; sudo apt install -y --no-install-recommends "$@"; }
|
||||
is_package_installed() { dpkg -s "$1" &>/dev/null; }
|
||||
|
||||
color_cyan
|
||||
echo
|
||||
echo "Starting Debian Server setup..."
|
||||
color_reset
|
||||
echo "DE: $DE, TWM: $TWM, Install Level: $INSTALL_LEVEL"
|
||||
echo
|
||||
color_yellow; echo "Starting Server setup..."; color_reset
|
||||
|
||||
# Optionally add Server-specific packages here
|
||||
install_packages linux-headers-$(uname -r)
|
||||
color_green; echo "Server setup completed."; color_reset
|
||||
|
||||
# Pause
|
||||
read -n 1 -s -r -p "Press any key to continue"
|
||||
|
||||
Reference in New Issue
Block a user