-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·65 lines (53 loc) · 1.61 KB
/
install.sh
File metadata and controls
executable file
·65 lines (53 loc) · 1.61 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
#!/usr/bin/env bash
# Quick installation script for sifteroxy
set -euo pipefail
APP_DIR="/opt/sifteroxy"
SERVICE_NAME="sifteroxy"
CURRENT_USER="${SUDO_USER:-$USER}"
echo "Installing sifteroxy..."
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)"
exit 1
fi
# Install Python dependencies
echo "Installing Python dependencies..."
if command -v pip3 &> /dev/null; then
pip3 install -U requests "requests[socks]"
else
echo "Error: pip3 not found. Please install Python 3 and pip first."
exit 1
fi
# Create application directory
echo "Creating application directory: $APP_DIR"
mkdir -p "$APP_DIR"
mkdir -p "$APP_DIR/metrics"
mkdir -p "$APP_DIR/logs"
# Copy files
echo "Copying files..."
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cp "$SCRIPT_DIR/sifteroxy.py" "$APP_DIR/"
cp "$SCRIPT_DIR/sources.json" "$APP_DIR/"
cp "$SCRIPT_DIR/proxy_update.sh" "$APP_DIR/"
chmod +x "$APP_DIR/proxy_update.sh"
chmod +x "$APP_DIR/sifteroxy.py"
# Install systemd service and timer
echo "Installing systemd service and timer..."
cp "$SCRIPT_DIR/sifteroxy.service" "/etc/systemd/system/"
cp "$SCRIPT_DIR/sifteroxy.timer" "/etc/systemd/system/"
# Set ownership
chown -R "$CURRENT_USER:$CURRENT_USER" "$APP_DIR"
# Reload systemd
systemctl daemon-reload
echo ""
echo "Installation complete!"
echo ""
echo "To activate the timer, run:"
echo " sudo systemctl enable --now sifteroxy.timer"
echo ""
echo "Or use the convenience script:"
echo " sudo ./active.sh"
echo ""
echo "To check status:"
echo " sudo systemctl status sifteroxy.timer"
echo " sudo systemctl status sifteroxy.service"