-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·44 lines (36 loc) · 956 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
39
40
41
42
43
44
#!/bin/bash
# Change to own dir
curdir="$(pwd)"
kkrcdir="$(dirname "$0")"
cd "$kkrcdir" || exit 1
# Installs the softlinks in place.
mysoftlink() {
local file="$1"
local softlink="$2"
echo "Removing softlink $file..."
if [ -L "$softlink" ]; then
echo "OK: Softlink. Removing."
rm "$softlink"
else
echo "WARNING: $softlink is not a softlink"
fi
# Just for pretty formatting
echo
}
# Process all files/dirs
. ./kkrc-files
# .bashrc.orig is a special case, since that's where we moved the original.
# Now rename it back
if [ -f ~/.bashrc.orig ]; then
printf "OK: Renaming .bashrc.orig to .bashrc\n"
mv ~/.bashrc.orig ~/.bashrc
else
printf "INFO: No .bashrc.orig found\n"
fi
# Last step
echo "Ready to run 'rm -rf $kkrcdir'? (y/n)"
read -r A
if [ "$A" = "y" ]; then
cd "$curdir"
rm -rf "$kkrcdir"
fi