mirror of
https://github.com/unraid/webgui.git
synced 2026-02-27 04:41:20 -06:00
- 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
This commit is contained in:
25
emhttp/plugins/dynamix/scripts/console
Executable file
25
emhttp/plugins/dynamix/scripts/console
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user