-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·110 lines (93 loc) · 2.95 KB
/
install.sh
File metadata and controls
executable file
·110 lines (93 loc) · 2.95 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash
# Installation script for Linux Antivirus Scanner
# For Debian-based systems (Ubuntu, Pop!_OS, Debian, etc.)
set -e
echo "======================================"
echo "Linux Antivirus Scanner Installation"
echo "======================================"
echo ""
# Check if running on Debian-based system
if ! command -v apt &> /dev/null; then
echo "Error: This script is for Debian-based systems only"
exit 1
fi
# Check if running as root/sudo
if [ "$EUID" -ne 0 ]; then
echo "Please run with sudo:"
echo "sudo ./install.sh"
exit 1
fi
# Install Python3 and pip if not already installed
echo "Checking Python installation..."
if ! command -v python3 &> /dev/null; then
echo "Installing Python3..."
apt update
apt install -y python3
fi
if ! command -v pip3 &> /dev/null; then
echo "Installing pip3..."
apt install -y python3-pip
fi
# Install required Python packages
echo ""
echo "Installing Python dependencies..."
pip3 install -r requirements.txt
# Create installation directory
INSTALL_DIR="/opt/linux-av"
echo ""
echo "Creating installation directory: $INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
# Copy files
echo "Copying files..."
cp linux_av.py "$INSTALL_DIR/"
cp file_monitor.py "$INSTALL_DIR/"
chmod +x "$INSTALL_DIR/linux_av.py"
chmod +x "$INSTALL_DIR/file_monitor.py"
# Create symbolic links
echo "Creating symbolic links..."
ln -sf "$INSTALL_DIR/linux_av.py" /usr/local/bin/linux-av
ln -sf "$INSTALL_DIR/file_monitor.py" /usr/local/bin/linux-av-monitor
# Create default config for the current user
SUDO_USER_HOME=$(eval echo ~$SUDO_USER)
CONFIG_FILE="$SUDO_USER_HOME/.linux-av.conf"
if [ ! -f "$CONFIG_FILE" ]; then
echo ""
echo "Creating default configuration..."
sudo -u $SUDO_USER python3 "$INSTALL_DIR/linux_av.py" --create-config --config "$CONFIG_FILE"
fi
# Create systemd service file for file monitor (optional)
SERVICE_FILE="/etc/systemd/system/linux-av-monitor.service"
cat > "$SERVICE_FILE" << EOF
[Unit]
Description=Linux Antivirus File Monitor
After=network.target
[Service]
Type=simple
User=$SUDO_USER
ExecStart=/usr/local/bin/linux-av-monitor --config $CONFIG_FILE
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
echo ""
echo "======================================"
echo "Installation completed successfully!"
echo "======================================"
echo ""
echo "Next steps:"
echo "1. Edit your configuration file: $CONFIG_FILE"
echo "2. Add your VirusTotal API key to the configuration"
echo ""
echo "Usage:"
echo " linux-av --file /path/to/file # Scan a single file"
echo " linux-av --directory ~/Downloads # Scan a directory"
echo " linux-av --help # Show all options"
echo ""
echo "File Monitor:"
echo " linux-av-monitor --directory ~/Downloads # Monitor Downloads folder"
echo ""
echo "To enable automatic monitoring on system startup:"
echo " sudo systemctl enable linux-av-monitor"
echo " sudo systemctl start linux-av-monitor"
echo ""