AutoRecon/scripts/install-tools.sh

62 lines
1.8 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Security Tools Installation Script (Main Router)
# Usage: ./scripts/install-tools.sh [OS_ID] [OS_ID_LIKE] [WSL_DETECTED]
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Source system info from environment or parameters
OS_ID=${1:-$OS_ID}
OS_ID_LIKE=${2:-$OS_ID_LIKE}
WSL_DETECTED=${3:-$WSL_DETECTED}
install_fallback_tools() {
echo " Unsupported Linux distribution: $OS_ID"
echo " Installing basic requirements..."
sudo apt update -qq 2>/dev/null || true
sudo apt install -y python3-venv python3-pip curl wget git 2>/dev/null || true
echo " Please install security tools manually or use Docker setup"
}
# Main installation logic
main() {
if [ -z "$OS_ID" ]; then
echo "❌ OS_ID not provided. Run system-check.sh first or provide OS_ID as parameter."
exit 1
fi
# Export variables for sub-scripts
export OS_ID OS_ID_LIKE WSL_DETECTED
case "$OS_ID" in
kali|parrot)
"$SCRIPT_DIR/install-tools-debian.sh" "$WSL_DETECTED"
;;
ubuntu|debian)
if echo "$OS_ID_LIKE" | grep -q "debian\|ubuntu"; then
"$SCRIPT_DIR/install-tools-debian.sh" "$WSL_DETECTED"
else
install_fallback_tools
fi
;;
arch|manjaro)
"$SCRIPT_DIR/install-tools-arch.sh"
;;
macos)
"$SCRIPT_DIR/install-tools-macos.sh"
;;
*)
if [ -f /etc/os-release ] && echo "$OS_ID_LIKE" | grep -q "debian\|ubuntu"; then
"$SCRIPT_DIR/install-tools-debian.sh" "$WSL_DETECTED"
else
install_fallback_tools
fi
;;
esac
}
# Run if script is executed directly
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
main "$@"
fi