summaryrefslogtreecommitdiffstats
path: root/src/etc/skel
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-05-31 09:54:04 -0300
committerRenato Botelho <renato@netgate.com>2016-05-31 09:54:04 -0300
commitfbe3b3ab4776ec65f7c67da45030410b074c9382 (patch)
treeb04631b92b5dd10501eda25880df7c9b15ad10b3 /src/etc/skel
parent9c75e83b665a9e4c063c3c1a5cec29167b6b1c4f (diff)
downloadpfsense-fbe3b3ab4776ec65f7c67da45030410b074c9382.zip
pfsense-fbe3b3ab4776ec65f7c67da45030410b074c9382.tar.gz
Improve interactive shell detection to cover other terminal types
Diffstat (limited to 'src/etc/skel')
-rw-r--r--src/etc/skel/dot.profile15
-rw-r--r--src/etc/skel/dot.shrc13
2 files changed, 26 insertions, 2 deletions
diff --git a/src/etc/skel/dot.profile b/src/etc/skel/dot.profile
index 700597a..6ef0bee 100644
--- a/src/etc/skel/dot.profile
+++ b/src/etc/skel/dot.profile
@@ -1,5 +1,18 @@
# Detect interactive logins and display the shell
-if [ -n "${SSH_TTY}" -o "${TERM}" = "cons25" ]; then
+unset _interactive
+if [ -n "${SSH_TTY}" ]; then
+ _interactive=1
+else
+ case "${TERM}" in
+ cons25|xterm|vt100|vt102|vt220)
+ _interactive=1
+ ;;
+ esac
+fi
+
+if [ -n "${_interactive}" ]; then
+ echo "INTERACTIVE"
/etc/rc.initial
exit
fi
+ echo "NON"
diff --git a/src/etc/skel/dot.shrc b/src/etc/skel/dot.shrc
index d3c9208..e75c845 100644
--- a/src/etc/skel/dot.shrc
+++ b/src/etc/skel/dot.shrc
@@ -8,7 +8,18 @@ if [ "${HTTP_PROXY}" != "" ]; then
fi
# Detect interactive logins and display the shell
-if [ -n "${SSH_TTY}" -o "${TERM}" = "cons25" ]; then
+unset _interactive
+if [ -n "${SSH_TTY}" ]; then
+ _interactive=1
+else
+ case "${TERM}" in
+ cons25|xterm|vt100|vt102|vt220)
+ _interactive=1
+ ;;
+ esac
+fi
+
+if [ -n "${_interactive}" ]; then
/etc/rc.initial
exit
fi
OpenPOWER on IntegriCloud