From c823bd4475bdeaa08a4fb8d224feca2370ecf743 Mon Sep 17 00:00:00 2001 From: Dave Russell <39733752+007revad@users.noreply.github.com> Date: Sat, 20 Jul 2024 09:12:09 +1000 Subject: [PATCH] Create edit_extjs-patch.sh --- edit_extjs-patch.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 edit_extjs-patch.sh 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" +