#!/bin/bash # Obținem IP-ul public (forțat IPv4) PUBLIC_IP=$(curl -4 -s ifconfig.me) # Verificăm dacă serviciul danted există pe sistem if systemctl list-unit-files | grep -q "danted.service"; then # Verificăm dacă rulează if systemctl is-active --quiet danted; then echo "SOCKS5 activ pe $PUBLIC_IP:1080" else # Dacă e oprit, îl pornim systemctl start danted echo "SOCKS5 pornit pe $PUBLIC_IP:1080" fi else # Dacă nu e găsit sub numele danted, verificăm sockd (numele de pe CentOS vechi) if systemctl list-unit-files | grep -q "sockd.service"; then if systemctl is-active --quiet sockd; then echo "SOCKS5 activ pe $PUBLIC_IP:1080" else systemctl start sockd echo "SOCKS5 pornit pe $PUBLIC_IP:1080" fi else echo "Serviciul proxy nu a fost găsit pe $PUBLIC_IP" fi fi