-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_uninstall.sh
More file actions
executable file
·47 lines (38 loc) · 1.3 KB
/
client_uninstall.sh
File metadata and controls
executable file
·47 lines (38 loc) · 1.3 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
while true; do
read -rp "Are you sure you want to uninstall? Configuration and certificates will be removed (Y/n)" uninstall
if [[ "$uninstall" == "Y" || "$uninstall" == "yes" ]]; then
echo "Uninstall confirmed"
break
elif [[ "$uninstall" == "n" || "$uninstall" == "no" ]]; then
echo "Uninstallation cancelled"
exit 1
else
echo "Please enter 'Y'/'yes' to confirm or 'n'/'no' to cancel"
fi
done
OS="$(uname)"
if [[ "$OS" == "Darwin" ]]; then
echo "Uninstalling for macOS..."
echo "Removing launchd plist"
launchctl unload /Library/LaunchDaemons/com.veil.client.plist
rm /var/log/veil-client.log /var/log/veil-client.err
echo "Removing veil environment"
rm -rf /etc/veilj
echo "Removing binaries"
rm /usr/local/bin/veil-client-service /usr/local/bin/veil-cli /usr/local/bin/veilctl
elif [[ "$OS" == "Linux" ]]; then
echo "Uninstalling for linux system..."
echo "Removing systemd service..."
systemctl stop veil.service
systemctl disable veil.service
rm /etc/systemd/system/veil.service
systemctl daemon-reload
systemctl reset-failed
echo "Removing veil environment"
rm -rf /etc/veil
echo "Removing binaries"
rm /bin/veil-client-service /bin/veil-cli /bin/veilctl
else
echo "Unsupported OS: $OS"
exit 1
fi