From 7b6710824f8ddde3d286f429b8623a369afa5039 Mon Sep 17 00:00:00 2001
From: Salt <rehashedsalt@cock.li>
Date: Fri, 2 Nov 2018 21:40:38 -0500
Subject: [PATCH] Add prefix to rbash shells TODO: Make that more robust. One
 can make a shell restricted in more ways than just calling via rbash

---
 .profile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/.profile b/.profile
index 9f2cdb90..8a072d0e 100755
--- a/.profile
+++ b/.profile
@@ -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)