-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
51 lines (42 loc) · 1.49 KB
/
uninstall.sh
File metadata and controls
51 lines (42 loc) · 1.49 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
#!/bin/bash
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}[!] Jalankan dengan sudo: sudo bash uninstall.sh${NC}"
exit 1
fi
echo -e "${YELLOW}[*] Uninstall Surfshark SOCKS5 Proxy${NC}"
read -p " Yakin hapus semua? [y/N]: " CONFIRM
if [[ ! "$CONFIRM" =~ ^[Yy]$ ]]; then
echo "Dibatalkan."
exit 0
fi
# Load config
source /etc/surfshark-socks5.conf 2>/dev/null || true
echo -e "${RED}[1/4] Stop services...${NC}"
systemctl stop surfshark-socks5 2>/dev/null || true
systemctl stop surfshark-vpn 2>/dev/null || true
systemctl disable surfshark-socks5 2>/dev/null || true
systemctl disable surfshark-vpn 2>/dev/null || true
echo -e "${RED}[2/4] Hapus service files...${NC}"
rm -f /etc/systemd/system/surfshark-vpn.service
rm -f /etc/systemd/system/surfshark-socks5.service
systemctl daemon-reload
echo -e "${RED}[3/4] Hapus config files...${NC}"
rm -f /etc/openvpn/surfshark-socks.conf
rm -f /etc/openvpn/surfshark-socks-ca.crt
rm -f /etc/openvpn/surfshark-socks-ta.key
rm -f /etc/openvpn/surfshark-socks-auth.txt
rm -f /etc/surfshark-socks5.conf
rm -f /usr/local/bin/surfshark-socks-start.sh
echo -e "${RED}[4/4] Cleanup routing...${NC}"
if [ -n "$TUN_TABLE" ]; then
ip rule del table "$TUN_TABLE" 2>/dev/null || true
ip route flush table "$TUN_TABLE" 2>/dev/null || true
fi
echo ""
echo -e "${GREEN} ✅ Uninstall selesai.${NC}"
echo -e " Note: OpenVPN & microsocks binary tidak dihapus (mungkin dipakai service lain)."