]> ##a long time ago in a galaxy far far away - initial release &txz_url; &txz_sha256; =') && !preg_match('/^6\\.12\\.0-/', $version); if ($is_stable_6_12_or_higher) { echo "Running on supported version {$version}\n"; exit(0); } echo "Warning: Unsupported Unraid version {$version}. This plugin requires Unraid 6.12.0 or higher.\n"; echo "The plugin may not function correctly on this system.\n"; exit(0); ]]> ||g' "/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php" # Add unraid-modals element if not already present if ! grep -q '' "/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php"; then sed -i 's||\n|' "/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php" fi fi ]]> MAINNAME="&name;" /dev/null) if [ -z "$UNRAID_VERSION" ]; then echo "Warning: Unable to parse version from /etc/unraid-version" echo "Using safe removal method (plugin file removal + reboot)" is_7_2_or_higher=true # Default to safe method else # Check if this is Unraid 7.2 or higher (including RCs and prereleases) if [[ "$UNRAID_VERSION" =~ ^7\.([2-9]|[1-9][0-9]+)\. ]] || [[ "$UNRAID_VERSION" =~ ^([8-9]|[1-9][0-9]+)\. ]]; then is_7_2_or_higher=true fi fi else echo "Warning: /etc/unraid-version file not found or not readable" echo "Using safe removal method (plugin file removal + reboot)" is_7_2_or_higher=true # Default to safe method fi if [ "$is_7_2_or_higher" = true ]; then echo "Unraid 7.2+ detected. Using safe removal method." if ! /etc/rc.d/rc.unraid-api plugins remove unraid-api-plugin-connect -b; then echo "Warning: Failed to remove connect API plugin" fi # Send notification to user /usr/local/emhttp/webGui/scripts/notify \ -e "Unraid Connect" \ -s "Reboot Required for Unraid Connect Removal" \ -d "Unraid Connect plugin has been marked for removal. Please reboot your server to complete the uninstallation." \ -i "warning" # Remove the plugin file so it won't be installed on reboot PLUGIN_FILE="/boot/config/plugins/${MAINNAME}.plg" if [ -f "$PLUGIN_FILE" ]; then echo "Removing plugin file: $PLUGIN_FILE" rm -f "$PLUGIN_FILE" fi echo "Plugin marked for removal. Reboot required to complete uninstallation." else # Original removal method for older versions # Find any installed dynamix.unraid.net package pkg_installed=$(ls -1 /var/log/packages/dynamix.unraid.net* 2>/dev/null | head -1) if [ -n "$pkg_installed" ]; then pkg_basename=$(basename "$pkg_installed") echo "Removing package: $pkg_basename" removepkg --terse "$pkg_basename" else echo "No dynamix.unraid.net package found. Trying with basic package name." removepkg --terse "${MAINNAME}" fi fi # File restoration function echo "Restoring files..." # Define files to restore in a shell variable - must match backup list FILES_TO_RESTORE=( "/usr/local/emhttp/plugins/dynamix/DisplaySettings.page" "/usr/local/emhttp/plugins/dynamix/Registration.page" "/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php" "/usr/local/emhttp/plugins/dynamix/include/ProvisionCert.php" "/usr/local/emhttp/plugins/dynamix/include/UpdateDNS.php" "/usr/local/emhttp/plugins/dynamix/include/ReplaceKey.php" "/usr/local/emhttp/plugins/dynamix/include/Wrappers.php" "/usr/local/emhttp/plugins/dynamix.plugin.manager/Downgrade.page" "/usr/local/emhttp/plugins/dynamix.plugin.manager/Update.page" "/usr/local/emhttp/plugins/dynamix.plugin.manager/include/ShowChanges.php" "/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/showchanges" "/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/unraidcheck" "/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidCheck.php" "/usr/local/emhttp/plugins/dynamix.plugin.manager/include/UnraidCheckExec.php" "/usr/local/emhttp/plugins/dynamix.my.servers/Connect.page" "/usr/local/emhttp/plugins/dynamix.my.servers/MyServers.page" "/usr/local/emhttp/plugins/dynamix.my.servers/Registration.page" "/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers1.php" "/usr/local/emhttp/plugins/dynamix.my.servers/include/myservers2.php" "/usr/local/emhttp/plugins/dynamix.my.servers/include/state.php" "/usr/local/emhttp/plugins/dynamix.my.servers/data/server-state.php" "/usr/local/emhttp/plugins/dynamix.my.servers/include/reboot-details.php" "/usr/local/emhttp/plugins/dynamix.my.servers/include/translations.php" "/usr/local/emhttp/plugins/dynamix.my.servers/include/web-components-extractor.php" "/usr/local/emhttp/update.htm" "/usr/local/emhttp/logging.htm" "/etc/nginx/nginx.conf" "/etc/rc.d/rc.nginx" "/usr/share/mozilla/firefox/9n35r0i1.default/user.js" ) # Restore each file if backup exists for FILE in "${FILES_TO_RESTORE[@]}"; do [ -f "$FILE-" ] && mv -f "$FILE-" "$FILE" done # Handle the unraid-components directory DIR=/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components # Remove the archive's contents before restoring if [ -d "$DIR" ]; then rm -rf "$DIR" fi if [ -d "$DIR-" ]; then mv "$DIR-" "$DIR" echo "Restored directory: $DIR- to $DIR" fi ]]> TAG="&tag;" PKG_FILE="&source;" # Full path to the package file including .txz extension PKG_URL="&txz_url;" # URL where package was downloaded from PKG_NAME="&txz_name;" # Name of the package file