mirror of
https://github.com/LizardByte/Sunshine.git
synced 2024-11-18 02:09:49 +00:00
Create uninstall_pkg.sh
This commit is contained in:
parent
802e5c79fa
commit
c61b31e8a6
@ -598,6 +598,8 @@ elseif(UNIX)
|
||||
if(APPLE)
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
||||
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/macos/misc/uninstall_pkg.sh" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
else()
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/assets/" DESTINATION "${SUNSHINE_ASSETS_DIR}")
|
||||
install(DIRECTORY "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/config/" DESTINATION "${SUNSHINE_CONFIG_DIR}")
|
||||
|
39
src_assets/macos/misc/uninstall_pkg.sh
Normal file
39
src_assets/macos/misc/uninstall_pkg.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
|
||||
FILES=(pkgutil --files org.macports.Sunshine)
|
||||
|
||||
remove_config=True
|
||||
remove_apps=True
|
||||
|
||||
for n in {1..2}; do
|
||||
echo "Loop: $n"
|
||||
for file in "${FILES[@]}"; do
|
||||
if [[ $file == *sunshine.conf ]]; then
|
||||
if [ $remove_config == True ]; then
|
||||
while true; do
|
||||
read -p -r "Do you wish to remove 'sunshine.conf'?" yn
|
||||
case $yn in
|
||||
[Yy]* ) rm --force "$file"; break;;
|
||||
[Nn]* ) remove_config=False; break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
fi
|
||||
if [[ $file == *apps.json ]]; then
|
||||
if [ $remove_apps == True ]; then
|
||||
while true; do
|
||||
read -p -r "Do you wish to remove 'apps.conf'?" yn
|
||||
case $yn in
|
||||
[Yy]* ) rm --force "$file"; break;;
|
||||
[Nn]* ) remove_apps=False; break;;
|
||||
* ) echo "Please answer yes or no.";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
rm --force --dir "$file"
|
||||
done
|
||||
done
|
Loading…
Reference in New Issue
Block a user