-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
84 lines (67 loc) · 1.91 KB
/
install.sh
File metadata and controls
84 lines (67 loc) · 1.91 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# RustMapV3 One-Line Installation Script
# This script installs RustMapV3 and ensures ~/.cargo/bin is on PATH
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Helper functions
info() {
echo -e "${GREEN}[INFO]${NC} $1"
}
warn() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Rust is installed
if ! command -v cargo &> /dev/null; then
error "Rust/Cargo not found. Please install Rust first:"
echo " curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
exit 1
fi
info "Found Rust $(rustc --version)"
# Check if git is available
if ! command -v git &> /dev/null; then
error "Git not found. Please install git first."
exit 1
fi
# Create temporary directory
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"
info "Cloning RustMapV3 repository..."
git clone https://github.com/Wael-Rd/RustMapV3.git
cd RustMapV3
info "Building RustMapV3..."
cargo build --release
info "Installing RustMapV3..."
cargo install --path .
# Ensure ~/.cargo/bin is in PATH (permanent)
CARGO_BIN="$HOME/.cargo/bin"
if [[ ":$PATH:" != *":$CARGO_BIN:"* ]]; then
warn "~/.cargo/bin is not in PATH. Adding to ~/.profile..."
if ! grep -q 'export PATH="$HOME/.cargo/bin:$PATH"' ~/.profile; then
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.profile
info "Added to ~/.profile"
fi
fi
# Reload profile so RustMapV3 is available immediately
source ~/.profile
# Clean up
cd /
rm -rf "$TEMP_DIR"
info "Installation complete!"
info "Run: RustMapV3 --help"
# Test installation
if command -v RustMapV3 &> /dev/null; then
info "✓ RustMapV3 successfully installed and available"
echo ""
echo "Quick test:"
echo " RustMapV3 127.0.0.1 --preset fast --top 10 --no-nmap"
else
warn "RustMapV3 installed but not found in PATH"
echo "Please restart your shell or run: source ~/.profile"
fi