Files
Linux_post_install/preinstall.sh
T
Your Name 16bc6685f8 fix: honor --dry-run across install phases; repair repo conventions and doc drift
- spawn() now respects DRY_RUN, install.sh exports it to child phases, and
  postinstall.sh wraps every user-home mutation in run() — '--dry-run' no
  longer runs apt/install/clone or edits dotfiles for real
- gen-docs.sh chmods regenerated files to 644 (mktemp mv left them at 0600)
- make check now syntax-checks apps/, entertainment/, features/, templates/
- .gitignore protects config/authorized_keys + config/rclone.conf; drop the
  tracked empty authorized_keys and the stray 6 MB session file
- pos-system-health --send prints 'sent:' only when a platform sender exists,
  otherwise warns on stderr (notify_send is silent-fail)
- standardize sourced libs (no shebang); refresh AGENT_Context/DEV/APPS/SCRIPTS
  doc drift: notify.sh in lib lists, pos-health systemd units, tsui, scripts/,
  INTERACTIVE_CMDS list, entertainment scheduler (systemd timers only)
2026-08-09 03:01:58 -04:00

56 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
source "$(dirname "$0")/lib/common.sh"
DRY_RUN="${DRY_RUN:-0}"
usage() {
cat <<EOF
Usage: preinstall.sh [OPTIONS]
Install system packages and tools.
Options:
--dry-run Show what would be done without executing
-h, --help Show this help message
EOF
exit 0
}
while [[ $# -gt 0 ]]; do
case "$1" in
--dry-run) DRY_RUN=1; shift ;;
-h|--help) usage ;;
*) err "Unknown option: $1" ;;
esac
done
PACKAGES=(
git curl wget vim nano tmux tree jq
unzip zip rsync htop btop telnet
net-tools iputils-ping traceroute tcpdump nmap
openssh-client openssh-server ufw fail2ban
nfs-common nfs-kernel-server
hostapd dnsmasq iptables iw
ca-certificates gnupg lsb-release
python3 python3-pip rclone
libqrencode4 libgtk-3-0
)
spawn "apt update" sudo apt update
spawn "Installing packages" sudo apt install -y "${PACKAGES[@]}"
#spawn "add user to sudo list" usermod -aG sudo $USER
spawn "Installing yt-dlp" sudo curl -L \
https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
-o /usr/local/bin/yt-dlp
run sudo chmod a+rx /usr/local/bin/yt-dlp
log "Verifying installations..."
for cmd in git yt-dlp; do
if command -v "$cmd" &>/dev/null; then
run "$cmd" --version
fi
done
log "Pre-install completed."