2024-05-05 06:16:56 +07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the MIT License.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
_BUILD="$(/bin/get_key_value /etc.defaults/VERSION buildnumber)"
|
|
|
|
|
|
|
|
if [ ${_BUILD:-64570} -gt 64570 ]; then
|
|
|
|
FILE_JS="/usr/local/packages/@appstore/StorageManager/ui/storage_panel.js"
|
|
|
|
else
|
|
|
|
FILE_JS="/usr/syno/synoman/webman/modules/StorageManager/storage_panel.js"
|
|
|
|
fi
|
|
|
|
FILE_GZ="${FILE_JS}.gz"
|
|
|
|
[ -f "${FILE_JS}" -a ! -f "${FILE_GZ}" ] && gzip -c "${FILE_JS}" >"${FILE_GZ}"
|
|
|
|
|
|
|
|
[ ! -f "${FILE_GZ}" ] && echo "${FILE_GZ} file does not exist" && exit 0
|
|
|
|
|
|
|
|
if [ "${1}" = "-r" ]; then
|
|
|
|
if [ -f "${FILE_GZ}.bak" ]; then
|
|
|
|
mv -f "${FILE_GZ}.bak" "${FILE_GZ}"
|
|
|
|
gzip -dc "${FILE_GZ}" >"${FILE_JS}"
|
|
|
|
fi
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ ! -f "${FILE_GZ}.bak" ] && cp -f "${FILE_GZ}" "${FILE_GZ}.bak"
|
|
|
|
|
|
|
|
gzip -dc "${FILE_GZ}" >"${FILE_JS}"
|
|
|
|
sed -i "s/e.portType||e.isCacheTray()/e.portType||false/" "${FILE_JS}"
|
2024-11-08 01:15:46 +07:00
|
|
|
sed -i 's/notSupportM2Pool_addOnCard:this.T("disk_info","disk_reason_m2_add_on_card"),//g' "${FILE_JS}"
|
|
|
|
sed -i 's/},{isConditionInvalid:0<this.pciSlot,invalidReason:"notSupportM2Pool_addOnCard"//g' "${FILE_JS}"
|
2024-05-05 06:16:56 +07:00
|
|
|
gzip -c "${FILE_JS}" >"${FILE_GZ}"
|
|
|
|
|
2024-05-19 22:03:37 +07:00
|
|
|
exit 0
|