-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstaller.sh
47 lines (39 loc) · 1.08 KB
/
uninstaller.sh
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
#!/bin/bash
latesturl="https://asar.goose.icu/asar/latest"
paths=(
"/usr/share/discord/resources/app.asar"
"/opt/discord/resources/app.asar"
"/usr/lib/discord/resources/app.asar"
"/usr/lib64/discord/resources/app.asar"
"/var/lib/flatpak/app/com.discordapp.Discord/current/active/files/discord/resources/app.asar"
"$HOME/.local/share/flatpak/app/com.discordapp.Discord/current/active/files/discord/resources/app.asar"
)
# =======
echo "OpenAsar Installer"
found=false
# discord killing process
if pgrep -x "Discord" >/dev/null; then
echo "Killing Discord..."
killall Discord
echo "Done."
fi
# main replacement
for path in "${paths[@]}"; do
if [ -f "$path" ]; then
found=true
echo "Discord asar found."
echo "Downloading patched file..."
if sudo wget -q "$latesturl" -O "$path"; then
echo "Sucessful. Exiting..."
nohup Discord &>/dev/null &
exit 0
else
echo "Failure downloading, check your internet connection."
exit 1
fi
fi
done
if [ "$found" != true ]; then
echo "app.asar was not found, exiting..."
exit 1
fi