Improve xpui detection

- checks for existence of `xpui.spa` before attempting any other xpui handling.
This commit is contained in:
jetfir3 2022-10-21 11:58:53 -04:00 committed by GitHub
parent ff866ebbe1
commit cda9aecfae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,8 +96,12 @@ echo "SpotX-Linux by @SpotX-CLI"
echo "**************************"
echo
# Handle xpui.bak and FORCE_FLAG logic
if [[ "${FORCE_FLAG}" == "false" ]]; then
# xpui detection
if [[ ! -f "${XPUI_SPA}" ]]; then
echo "xpui not found, skipping xpui patches..."
XPUI_SKIP="true"
else
if [[ "${FORCE_FLAG}" == "false" ]]; then
if [[ -f "${XPUI_BAK}" ]]; then
echo "SpotX backup found, SpotX has already been used on this install."
echo -e "Re-run SpotX using the '-f' flag to force xpui patching.\n"
@ -107,7 +111,7 @@ if [[ "${FORCE_FLAG}" == "false" ]]; then
echo "Creating xpui backup..."
cp "${XPUI_SPA}" "${XPUI_BAK}"
XPUI_SKIP="false"; fi
else
else
if [[ -f "${XPUI_BAK}" ]]; then
echo "Backup xpui found, restoring original..."
rm "${XPUI_SPA}"
@ -116,7 +120,7 @@ else
else
echo "Creating xpui backup..."
cp "${XPUI_SPA}" "${XPUI_BAK}"
XPUI_SKIP="false"; fi; fi
XPUI_SKIP="false"; fi; fi; fi
# Extract xpui.spa
if [[ "${XPUI_SKIP}" == "false" ]]; then