mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-04-09 21:45:24 +00:00
Fix macos uninstall pkg script
This commit is contained in:
parent
a1d8cc2296
commit
7019756fa1
@ -1,39 +1,58 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
FILES=(pkgutil --files org.macports.Sunshine)
|
package_name=org.macports.Sunshine
|
||||||
|
|
||||||
|
echo "Removing files now..."
|
||||||
|
FILES=$(pkgutil --files --only-files $package_name)
|
||||||
|
|
||||||
remove_config=True
|
remove_config=True
|
||||||
remove_apps=True
|
remove_apps=True
|
||||||
|
|
||||||
for n in {1..2}; do
|
for file in ${FILES}; do
|
||||||
echo "Loop: $n"
|
file="/$file"
|
||||||
for file in "${FILES[@]}"; do
|
remove_current=True
|
||||||
if [[ $file == *sunshine.conf ]]; then
|
if [[ $file == *sunshine.conf ]]; then
|
||||||
if [ $remove_config == True ]; then
|
if [[ $remove_config == True ]]; then
|
||||||
while true; do
|
while true; do
|
||||||
read -p -r "Do you wish to remove 'sunshine.conf'?" yn
|
read -p -r "Do you wish to remove 'sunshine.conf'?" yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) rm --force "$file"; break;;
|
[Yy]* ) echo "removing: $file"; rm -f "$file"; break;;
|
||||||
[Nn]* ) remove_config=False; break;;
|
[Nn]* ) remove_config=False; remove_current=False; break;;
|
||||||
* ) echo "Please answer yes or no.";;
|
* ) echo "Please answer yes or no.";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
if [[ $file == *apps.json ]]; then
|
fi
|
||||||
if [ $remove_apps == True ]; then
|
if [[ $file == *apps.json ]]; then
|
||||||
while true; do
|
if [[ $remove_apps == True ]]; then
|
||||||
read -p -r "Do you wish to remove 'apps.conf'?" yn
|
while true; do
|
||||||
case $yn in
|
read -p -r "Do you wish to remove 'apps.conf'?" yn
|
||||||
[Yy]* ) rm --force "$file"; break;;
|
case $yn in
|
||||||
[Nn]* ) remove_apps=False; break;;
|
[Yy]* ) echo "removing: $file"; rm -f "$file"; break;;
|
||||||
* ) echo "Please answer yes or no.";;
|
[Nn]* ) remove_apps=False; remove_current=False; break;;
|
||||||
esac
|
* ) echo "Please answer yes or no.";;
|
||||||
done
|
esac
|
||||||
fi
|
done
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
rm --force --dir "$file"
|
if [[ $remove_current == True ]]; then
|
||||||
done
|
echo "removing: $file"
|
||||||
|
rm -f "$file"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "Removing directories now..."
|
||||||
|
DIRECTORIES=$(pkgutil --files --only-dirs org.macports.Sunshine)
|
||||||
|
|
||||||
|
for dir in ${DIRECTORIES}; do
|
||||||
|
dir="/$dir"
|
||||||
|
echo "Checking if empty directory: $dir"
|
||||||
|
find "$dir" -type d -empty -exec rm -f -d {} \;
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Forgetting Sunshine..."
|
||||||
|
pkgutil --forget $package_name
|
||||||
|
|
||||||
|
echo "Sunshine has been uninstalled..."
|
||||||
|
Loading…
x
Reference in New Issue
Block a user