-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·52 lines (39 loc) · 2.94 KB
/
uninstall.sh
File metadata and controls
executable file
·52 lines (39 loc) · 2.94 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
#!/bin/bash
INSTALL_DIR="${INSTALL_DIR:-/opt/hekate}"
if [ "$(id -u)" != "0" ]; then
echo "Run as root: sudo bash uninstall.sh"
exit 1
fi
echo "Removing hekate ..."
# ── Services ──────────────────────────────────────────────────────────────────
systemctl stop hekate ap-routing ap0-create hostapd dnsmasq 2>/dev/null || true
systemctl disable hekate ap-routing ap0-create 2>/dev/null || true
rm -f /etc/systemd/system/hekate.service \
/etc/systemd/system/ap-routing.service \
/etc/systemd/system/ap0-create.service
systemctl daemon-reload
# ── Installation directory ────────────────────────────────────────────────────
rm -rf "$INSTALL_DIR"
# ── ap-routing script ─────────────────────────────────────────────────────────
rm -f /usr/local/sbin/ap-routing.sh
# ── NetworkManager configs ────────────────────────────────────────────────────
rm -f /etc/NetworkManager/conf.d/hekate-ap0.conf \
/etc/NetworkManager/conf.d/hekate-nomacrand.conf \
/etc/NetworkManager/conf.d/hekate-managed.conf
systemctl reload NetworkManager 2>/dev/null || true
# ── hostapd ───────────────────────────────────────────────────────────────────
rm -f /etc/hostapd/hostapd.conf
# ── dnsmasq ───────────────────────────────────────────────────────────────────
rm -f /etc/dnsmasq.d/ap0.conf \
/etc/dnsmasq.d/upstream-dns.conf \
/etc/dnsmasq.d/static-leases.conf \
/etc/dnsmasq.d/hekate-dns.conf
# ── Hekate config dir ─────────────────────────────────────────────────────────
rm -rf /etc/hekate
# ── nftables ─────────────────────────────────────────────────────────────────
nft delete table inet hekate 2>/dev/null || true
nft delete table ip nat 2>/dev/null || true
nft delete table ip ap_routing 2>/dev/null || true
# ── ap0 virtual interface ─────────────────────────────────────────────────────
iw dev ap0 del 2>/dev/null || true
echo "Done. Everything removed."