mirror of
https://github.com/unraid/webgui.git
synced 2025-12-31 06:30:10 -06:00
- 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
26 lines
775 B
Bash
Executable File
26 lines
775 B
Bash
Executable File
#!/bin/bash
|
|
# Load keyboard layout for local console
|
|
loadkeys -q $1
|
|
|
|
# Set screenblank and powersave for local console
|
|
if [[ $2 =~ ^[0-9]+$ ]]; then
|
|
TERM=linux setterm --blank=$2 --powersave off >/dev/console
|
|
elif [[ $2 == disabled ]]; then
|
|
TERM=linux setterm --blank=0 --powersave off >/dev/console
|
|
else
|
|
TERM=linux setterm --blank 15 --powersave powerdown --powerdown 60 >/dev/console
|
|
fi
|
|
|
|
# Enable or disable persistent bash history
|
|
if [[ $3 == 1 ]]; then
|
|
if [[ ! -d /boot/config/history ]]; then
|
|
mkdir -p /boot/config/history
|
|
fi
|
|
rm -f /root/.bash_history
|
|
touch /boot/config/history/bash_history
|
|
ln -s /boot/config/history/bash_history /root/.bash_history
|
|
else
|
|
rm -f /boot/config/history/bash_history /root/.bash_history
|
|
touch /root/.bash_history
|
|
fi
|