Add prefix to rbash shells

TODO: Make that more robust. One can make a shell restricted in more ways than just calling via rbash
This commit is contained in:
Salt 2018-11-02 21:40:38 -05:00
parent 65d45b44ec
commit 7b6710824f

View File

@ -103,12 +103,15 @@ _ps1() {
# Add hostname prefix in SSH sessions
if [ "$SSH_CLIENT" ]; then
# Also add the machine's hostname
prefix="${fg_bold}${fg_red}`hostname`${r}${fg_red}:"
fi
# Append a "restricted" prefix in rbash
if [ "$0" == "rbash" ]; then
prefix="${fg_bold}${fg_grey}rbash${r}:"
fi
# Change PWD color depending on the shell
case $0 in
bash)
*bash)
prefix="${prefix}${fg_yellow}"
;;
ksh)