Initial commit: zapret-discord-youtube-linux v1.9.8c-linux
This commit is contained in:
+77
@@ -0,0 +1,77 @@
|
||||
#!/bin/bash
|
||||
# install.sh - One-shot installer: setup + build + autotest + systemd install
|
||||
# Run once after cloning the repository.
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/lib/functions.sh"
|
||||
|
||||
if [[ "$EUID" -ne 0 ]]; then
|
||||
print_red "[!] This script must be run as root (or with sudo)"
|
||||
echo " sudo ./install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=============================================="
|
||||
echo " Zapret for Linux - Full Installer"
|
||||
echo "=============================================="
|
||||
echo ""
|
||||
echo " This will:"
|
||||
echo " 1. Install dependencies (git, make, gcc, curl)"
|
||||
echo " 2. Build nfqws binary from source"
|
||||
echo " 3. Run autotest to find working strategy"
|
||||
echo " 4. Install systemd service for auto-start"
|
||||
echo ""
|
||||
read -rp "Continue? [Y/n]: " ans
|
||||
if [[ "${ans:-Y}" != [yY]* ]]; then
|
||||
echo "Aborted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Step 1: Setup
|
||||
echo ""
|
||||
echo "[*] Step 1/4: Running setup..."
|
||||
bash "$SCRIPT_DIR/setup.sh"
|
||||
|
||||
# Step 2: Build (done inside setup, but verify)
|
||||
echo ""
|
||||
echo "[*] Step 2/4: Verifying build..."
|
||||
check_nfqws || {
|
||||
print_red "[!] nfqws not found after setup. Trying to rebuild..."
|
||||
bash "$SCRIPT_DIR/install_nfqws.sh"
|
||||
}
|
||||
|
||||
# Step 3: Auto-test
|
||||
echo ""
|
||||
echo "[*] Step 3/4: Auto-testing strategies..."
|
||||
bash "$SCRIPT_DIR/autotest.sh" --auto
|
||||
|
||||
# Step 4: Done
|
||||
echo ""
|
||||
print_green "=============================================="
|
||||
print_green " Installation Complete!"
|
||||
print_green "=============================================="
|
||||
echo ""
|
||||
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
echo "[*] Service status:"
|
||||
systemctl status zapret --no-pager 2>/dev/null || true
|
||||
echo ""
|
||||
echo "Commands:"
|
||||
echo " sudo systemctl status zapret # check status"
|
||||
echo " sudo systemctl stop zapret # stop"
|
||||
echo " sudo systemctl start zapret # start"
|
||||
echo " sudo systemctl restart zapret # restart"
|
||||
echo " sudo journalctl -u zapret -f # view logs"
|
||||
else
|
||||
echo "[*] systemd not found. To start manually:"
|
||||
echo " sudo ./general.sh (or any other strategy)"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "[*] To update in the future:"
|
||||
echo " sudo ./update.sh # check for new version + rebuild"
|
||||
echo " sudo ./update.sh --full-auto # force rebuild + re-test"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user