Files
webgui/etc/rc.d/rc.setterm
ich777 2cb6e86f93 - Create page for Local Console
- Create console script
- Create rc.keymap and modify default ot be compatible with local console settings
- Change rc.setterm to be compatible with local console settings
- Change rc.local to be compatible with persistent bash history
2023-11-13 19:42:44 +01:00

24 lines
932 B
Bash
Executable File

#!/bin/bash
#
# This file provides the command line for the setterm utility to set the
# terminal attributes (primarily used for screen blanking and power
# management).
#
# LimeTech - modified for Unraid OS
# Bergware - modified for Unraid OS, October 2023
# Read Unraid config file and set timout or fall back to default
SCREEN_BLANK=$(grep "screen_blank" /boot/config/plugins/dynamix/dynamix.cfg 2>/dev/null | cut -d'=' -f2 | sed 's/"//g')
if [[ $SCREEN_BLANK =~ ^[0-9]+$ ]]; then
setterm --blank $SCREEN_BLANK --powersave off
elif [[ $SCREEN_BLANK == disabled ]]; then
setterm --blank=0 --powersave off
else
# Screen blanks after 15 minutes idle time, and powers down in one hour
# if the kernel supports APM or ACPI power management (default setting):
setterm --blank 15 --powersave powerdown --powerdown 60
fi
# Screen does not blank or use power management features:
#setterm -blank 0 -powersave off -powerdown 0