-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup-tools.sh
More file actions
executable file
·46 lines (37 loc) · 1.13 KB
/
setup-tools.sh
File metadata and controls
executable file
·46 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# Array of required tools
REQUIRED_TOOLS=("jq" "curl" "git" "unzip" "gpg" "lsb_release")
# Array of packages to install (some tools have different package names)
INSTALL_PACKAGES=("jq" "curl" "git" "unzip" "gnupg" "lsb-release" "net-tools" "apt-transport-https")
function check_tools() {
local missing_tools=()
echo "Checking required tools..."
for tool in "${REQUIRED_TOOLS[@]}"; do
if ! command -v "$tool" &> /dev/null; then
echo " ❌ $tool - not found"
missing_tools+=("$tool")
else
echo " ✅ $tool - found"
fi
done
if [ ${#missing_tools[@]} -eq 0 ]; then
echo "All required tools are installed!"
return 0
else
echo "Missing tools: ${missing_tools[*]}"
return 1
fi
}
function install_tools() {
echo "Installing required tools and dependencies..."
sudo apt-get update
sudo apt-get install -y "${INSTALL_PACKAGES[@]}"
echo "Installation completed. Verifying tools..."
check_tools
}
# Main logic
if check_tools; then
echo "Skipping tooling setup..."
else
install_tools
fi