forked from hectorm/elementary-dropbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.sh
executable file
·38 lines (28 loc) · 951 Bytes
/
uninstall.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
#!/usr/bin/env bash
# Author: Héctor Molinero Fernández <[email protected]>
# Repository: https://github.com/zant95/elementary-dropbox
# License: MIT, https://opensource.org/licenses/MIT
# Exit on errors
set -euo pipefail
# Globals
scriptDir=$(dirname "$(readlink -f "$0")")
# Process
source "$scriptDir"/common.sh
infoMsg 'Uninstalling Dropbox...'
if [ "$(pidof dropbox)" ]; then
killall dropbox
fi
if [ -f "$HOME"/.profile ]; then
sed -i '\|PATH="$HOME/.dropbox-bin:$PATH"|d' "$HOME"/.profile
fi
rm -rf \
"$HOME"/.dropbox-bin \
"$HOME"/.dropbox-dist \
"$HOME"/.local/share/applications/dropbox.desktop \
"$HOME"/.config/autostart/dropbox.desktop \
"$HOME"/.local/share/icons/hicolor/*x*/apps/dropbox.* \
"$HOME"/.local/share/icons/hicolor/*x*/apps/dropboxstatus-{blank,busy,busy2,idle,logo,x}.*
if [ -d "$HOME"/.dropbox ]; then
mv "$HOME"/.dropbox "$HOME"/.dropbox.$(date +%s).bak
fi
infoMsg 'Uninstallation complete!'