mirror of
https://github.com/stornic56/debianito-post-install.git
synced 2026-10-31 21:18:08 +00:00
9828ea439c
- Extracted hardware detection logic from firmware.sh into new modules/hw_detect.sh. Declares shared arrays (PCI_NET_DEVS, USB_WIFI_DEVS, etc) and _detect_all_network_devices() function. The main script now sources hw_detect.sh immediately after utils.sh. firmware.sh retains only _DETECTED_FW_PKGS and _FW_PLAN_PKG_LINES plus installation logic — the detection loop is fully removed, eliminating the circular dependency with bluetooth.sh. - Fixed interrupt safety in main script: removed pkill -f "apt.*install" and pkill -f "dpkg.*configure" from _on_interrupt(); updated exit message to "Temp files cleaned." Only the signal handler (trap _on_interrupt INT TERM) remains. - Added strict URL validation to modules/gaming/heroic.sh and modules/gaming/tools.sh using regex ^https://[A-Za-z0-9./_-]+\.deb$ before passing $deb_url to _run_cmd. Blocks command substitution, non-https URLs, and path traversal attempts that could bypass shell quoting. - Implemented real Bullseye Archive rewrite in modules/bullseye/legacy.sh: adds idempotency check (grep -q archive.debian.org && return 0), creates timestamped backup of /etc/apt/sources.list with sudo cp, writes exact archive Debian sources via sudo tee heredoc, and runs sudo apt-get update || true on failure. - Added local scope to modules/bluetooth.sh variable service_enable_only=false before the conditional assignment, preventing state bleed from the previous global-only declaration. - Applied safe array pattern (while IFS= read -r _pkg; do ...) across 32+ files in modules/extras/* and modules/bullseye/legacy.sh, replacing all vulnerable for pkg in $cleaned / for pkg in $install_list loops. Eliminates word-splitting and command-injection risks.
63 lines
2.8 KiB
Bash
63 lines
2.8 KiB
Bash
#!/usr/bin/env bash
|
|
# design.sh — Multimedia & Design (handbrake moved here from Media Players)
|
|
|
|
_cat_design() {
|
|
local headless=false
|
|
_is_headless && headless=true
|
|
local -a items=()
|
|
if ! $headless; then
|
|
local audacity_state; audacity_state=$(_state "audacity")
|
|
local ardour_state; ardour_state=$(_state "ardour")
|
|
local blender_state; blender_state=$(_state "blender")
|
|
local gimp_state; gimp_state=$(_state "gimp")
|
|
local handbrake_state; handbrake_state=$(_state "handbrake")
|
|
local inkscape_state; inkscape_state=$(_state "inkscape")
|
|
local kdenlive_state; kdenlive_state=$(_state "kdenlive")
|
|
local krita_state; krita_state=$(_state "krita")
|
|
local obs_state; obs_state=$(_state "obs-studio")
|
|
local openshot_state; openshot_state=$(_state "openshot-qt")
|
|
local scribus_state; scribus_state=$(_state "scribus")
|
|
local shotcut_state; shotcut_state=$(_state "shotcut")
|
|
items+=(
|
|
"audacity" "Audio editor/recorder" "$audacity_state"
|
|
"ardour" "Digital audio workstation" "$ardour_state"
|
|
"blender" "3D modeling/animation" "$blender_state"
|
|
"gimp" "Image editor" "$gimp_state"
|
|
"handbrake" "Video transcoder" "$handbrake_state"
|
|
"inkscape" "Vector graphics editor" "$inkscape_state"
|
|
"kdenlive" "Video editor (KDE)" "$kdenlive_state"
|
|
"krita" "Digital painting" "$krita_state"
|
|
"obs-studio" "Screen recording" "$obs_state"
|
|
"openshot-qt" "Simple video editor" "$openshot_state"
|
|
"scribus" "Desktop publishing" "$scribus_state"
|
|
"shotcut" "Cross-platform video editor" "$shotcut_state"
|
|
)
|
|
fi
|
|
local ffmpeg_state; ffmpeg_state=$(_state "ffmpeg")
|
|
items+=("ffmpeg" "Multimedia framework (CLI)" "$ffmpeg_state")
|
|
|
|
local item_count=${#items[@]}
|
|
local lista_alto=$((item_count > TUI_ALTO_LISTA ? TUI_ALTO_LISTA : item_count))
|
|
local choices
|
|
choices=$(_checklist "Multimedia & Design" "Check [*] the packages you want installed/updated on your system.\n" \
|
|
$TUI_ALTO $TUI_ANCHO $lista_alto "${items[@]}")
|
|
clear
|
|
|
|
[ -z "$choices" ] && return
|
|
local cleaned; cleaned=$(echo "$choices" | tr -d '"')
|
|
# BH-004: Convert to array to avoid word splitting and injection.
|
|
local -a _pkgs=()
|
|
while IFS= read -r _pkg; do
|
|
[ -n "$_pkg" ] && _pkgs+=("$_pkg")
|
|
done < <(echo "$cleaned" | tr ' ' '\n')
|
|
for pkg in "${_pkgs[@]}"; do
|
|
if ! is_installed "$pkg"; then
|
|
_run_install "$pkg"
|
|
else
|
|
echo "$pkg already installed."
|
|
fi
|
|
done
|
|
|
|
echo -e "${GREEN}Multimedia & design tools installed.${NC}"
|
|
}
|