-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathabs-uninstall.sh
More file actions
36 lines (27 loc) · 790 Bytes
/
Copy pathabs-uninstall.sh
File metadata and controls
36 lines (27 loc) · 790 Bytes
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
#!/bin/bash
#Request sudo permission.
sudo ls >/dev/null
# Set the s directorie
scripts_dir="/usr/bin"
# Find all scripts in the scripts directory
script_files=$(find "$scripts_dir" -type f -name "abs.*")
file_count=$(echo "$script_files" | wc -l)
if [ -n "$script_files" ]; then
if [ "$1" != "-y" ]; then
echo "We found "$file_count" abs scripts to remove."
read -p "Do you want to continue? [y/N] " flag
if [ "$flag" != "y" ] && [ "$flag" != "Y" ]; then
echo Abort.
exit 0
fi
fi
else
echo "We couldn't locate any ABS scripts."
exit 0
fi
IFS=$'\n';
for script in $script_files; do
sudo rm -f "$script"
echo "deleted : "$(basename "$script")""
done
echo "All of your ABS scripts have been deleted."