-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrmflash
executable file
·76 lines (71 loc) · 1.43 KB
/
rmflash
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
function confirm() {
echo -n " (Y/N) "
while read -r -s -n 1 'ch'; do
if [[ $ch == [YyNn] ]]; then
[[ $ch == [Yy] ]] && retval=0
[[ $ch == [Nn] ]] && retval=1
break
fi
done
echo
return $retval
}
echo
echo "Removing known Adobe/Macromedia/Flash directories ..."
echo
flashloc=(
~/Library/Caches/Adobe/Flash\ Player
~/Library/Caches/com.adobe.flashplayer.installmanager
~/Library/Preferences/Macromedia/Flash\ Player
/Library/PreferencePanes/Flash\ Player.prefPane
/Library/Application\ Support/Adobe/Flash\ Player\ Install\ Manager
/Library/Application\ Support/Macromedia
/Library/Internet\ Plug-Ins/Flash\ Player.plugin
/Library/Internet\ Plug-Ins/flashplayer.xpt
/Applications/Flash\ Player.app
~/Library/Preferences/com.macromedia.Flash\ Player.app.plist
)
for i in "${flashloc[@]}"; do
if [ -e "$i" ]; then
echo -n "Delete \"$i\"?"
if confirm; then
if [ -w "$i" ]; then
#echo "rm"
rm -fr "$i"
else
#echo "sudo rm"
sudo rm -fr "$i"
fi
fi
fi
done
echo
echo "Remaining files and directories:"
echo
pre=(
~/Library
/Library
/Applications
)
sub=(
""
/Caches
/Preferences
/PreferencePanes
/Application\ Support
/Internet\ Plug-Ins
)
for i in "${pre[@]}"; do
for j in "${sub[@]}"; do
dir="$i$j"
if [ -d "$dir" ]; then
res=$(ls -al "$dir" | grep -iE 'flash|adobe|macromedia')
if [ ! -z "$res" ]; then
echo "$dir"
echo "$res"
echo
fi
fi
done
done