Rename enableSystemInfo to ENABLE_SYSTEM_INFO

This commit is contained in:
rmm 2024-06-23 11:55:41 +02:00
parent 05c30a67f7
commit 79c9a13377

View File

@ -259,16 +259,16 @@ function configure {
local choiceEnableSystemInfo=$(ask "Do you wish to enable system information? (Y/n)") local choiceEnableSystemInfo=$(ask "Do you wish to enable system information? (Y/n)")
case "$choiceEnableSystemInfo" in case "$choiceEnableSystemInfo" in
[yY] | "") [yY] | "")
enableSystemInfo=true ENABLE_SYSTEM_INFO=true
info "System information will be displayed..." info "System information will be displayed..."
;; ;;
[nN]) [nN])
enableSystemInfo=false ENABLE_SYSTEM_INFO=false
info "System information will NOT be displayed..." info "System information will NOT be displayed..."
;; ;;
*) *)
warn "Invalid selection. System information will be displayed." warn "Invalid selection. System information will be displayed."
enableSystemInfo=true ENABLE_SYSTEM_INFO=true
;; ;;
esac esac
echo # add a new line echo # add a new line
@ -313,7 +313,7 @@ function install_mod {
msg "Sensors' output added to \"$NODES_PM_FILE\"." msg "Sensors' output added to \"$NODES_PM_FILE\"."
fi fi
if [[ "$enableSystemInfo" == true ]]; then if [ $ENABLE_SYSTEM_INFO = true ]; then
local systemInfoCmd=$(dmidecode -t 1 | awk -F': ' '/Manufacturer|Product Name|Serial Number/ {print $1": "$2}' | awk '{$1=$1};1' | sed 's/$/ |/' | paste -sd " " - | sed 's/ |$//') local systemInfoCmd=$(dmidecode -t 1 | awk -F': ' '/Manufacturer|Product Name|Serial Number/ {print $1": "$2}' | awk '{$1=$1};1' | sed 's/$/ |/' | paste -sd " " - | sed 's/ |$//')
sed -i "/my \$dinfo = df('\/', 1);/i\\\t\$res->{systemInfo} = \"$(echo "$systemInfoCmd")\";\n" "$NODES_PM_FILE" sed -i "/my \$dinfo = df('\/', 1);/i\\\t\$res->{systemInfo} = \"$(echo "$systemInfoCmd")\";\n" "$NODES_PM_FILE"
msg "System information output added to \"$NODES_PM_FILE\"." msg "System information output added to \"$NODES_PM_FILE\"."
@ -418,7 +418,7 @@ Ext.define('PVE.mod.TempHelper', {\n\
},\n\ },\n\
});\n" "$PVE_MANAGER_LIB_JS_FILE" });\n" "$PVE_MANAGER_LIB_JS_FILE"
if [[ $enableSystemInfo == "true" ]]; then if [ $ENABLE_SYSTEM_INFO = true ]; then
sed -i "/^Ext.define('PVE.node.StatusView',/ { sed -i "/^Ext.define('PVE.node.StatusView',/ {
:a; :a;
/items:/!{N;ba;} /items:/!{N;ba;}