update uninstall script, renames

This commit is contained in:
Pim Nelissen
2024-08-26 10:41:09 +02:00
parent 88205af3a5
commit aa8f16a571
5 changed files with 19 additions and 5 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/bash
PATH_TO_INSTALL=/home/$(whoami)/.local/bin
FILES=($PWD/scripts/pcs*)
FILES=($PWD/scripts/*)
NUM_OF_FILES=${#FILES[@]}
for f in ${FILES[*]}

View File

@ -1,8 +1,22 @@
#!/usr/bin/bash
PATH=/home/$(whoami)/.local/bin
TO_DELETE=($PATH/pcs*)
NUM_OF_FILES=${#TO_DELETE[@]}
PATH_TO_REMOVE=/home/$(whoami)/.local/bin
TO_DELETE=$()
/usr/bin/rm -f ${TO_DELETE[@]}
TO_DELETE=()
for i in "$PWD/scripts"/*; do
TO_DELETE+=("$(basename "$i")")
done
for filename in "${TO_DELETE[@]}"; do
if [ -e "$PATH_TO_REMOVE/$filename" ]; then
rm "$PATH_TO_REMOVE/$filename"
echo "Removed $PATH_TO_REMOVE/$filename"
else
echo "File $PATH_TO_REMOVE/$filename does not exist"
fi
done
NUM_OF_FILES=${#TO_DELETE[@]}
echo $NUM_OF_FILES scripts removed from $PATH.