diff --git a/edit_extjs-patch.sh b/edit_extjs-patch.sh new file mode 100644 index 0000000..0f6a303 --- /dev/null +++ b/edit_extjs-patch.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Fix Unrecognized firmware version + +# Check script is running as root +if [[ $( whoami ) != "root" ]]; then + echo "This script must be run as sudo or root!" + exit 1 +fi + +file="/usr/syno/synoman/synoSDSjslib/dist/extjs-patch.bundle.js" +#file="/volume1/test/extjs/extjs-patch.bundle.js" # debug ##################### + +# Restore extjs-patch.bundle.js from backup +if [[ ${1,,} == "--restore" ]]; then + if [[ -f "${file}.bak" ]]; then + cp -p "${file}.bak" "$file" + echo "Restored" && exit + else + echo "Backup not found!" && exit + fi +fi + +# Backup extjs-patch.bundle.js +cp -p "$file" "${file}.bak" + +# Edit extjs-patch.bundle.js +sed -i 's|:"upgrade_database"===e&&(a="sm-fwupgrade-upgrade-db-link",r="orange-status",o=_T("disk_info","fwupgrade_status_upgrade_database"))||g' "$file" + +echo "Finished" +