Tweak ash history file settings in debug mode (#548)

pull/554/head
Paul Philippov 2022-11-13 20:43:15 -05:00 committed by GitHub
parent eab344b4b4
commit 6148991ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@ export SENSOR=$(fw_printenv -n sensor)
export ARCH=$(uname -m)
export HISTFILE=/tmp/.ash_history
export DEBUG=$(($(fw_printenv -n debug)))
[ $DEBUG -ge 1 ] && [ -f "${HISTFILE//tmp/root}" ] && cp ${HISTFILE//tmp/root} /tmp/
[ $DEBUG -ge 2 ] && export HISTFILE=${HISTFILE//tmp/root}
echo_c() { echo -ne "\e[1;$1m$2\e[0m"; }
if [ "$PS1" ]; then