summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2012-01-17 00:51:33 -0800
committerSeth Mos <seth.mos@dds.nl>2012-01-17 00:51:33 -0800
commit1f4f9c7ce720df9ad07392683a38f3f1ace2760d (patch)
tree4473abe4e1689cc665d95ba7786e026d5ab9edf2
parent9feaf772fbe821868b03cd89caf70d162534502b (diff)
parenta7401ce73a2851a1099c89a61a57e180f02ceac3 (diff)
downloadpfsense-1f4f9c7ce720df9ad07392683a38f3f1ace2760d.zip
pfsense-1f4f9c7ce720df9ad07392683a38f3f1ace2760d.tar.gz
Merge pull request #41 from lotheac/master
.profile and .shrc cleanup
-rwxr-xr-xtmp/post_upgrade_command11
1 files changed, 3 insertions, 8 deletions
diff --git a/tmp/post_upgrade_command b/tmp/post_upgrade_command
index 1db2799..393cd68 100755
--- a/tmp/post_upgrade_command
+++ b/tmp/post_upgrade_command
@@ -33,14 +33,9 @@ if [ $PFSENSETYPE = "pfSense" ] || [ $PFSENSETYPE = "nanobsd" ]; then
fi
# Detect interactive logins and display the shell
-echo "if [ \`env | grep SSH_TTY | wc -l\` -gt 0 ] || [ \`env | grep cons25 | wc -l\` -gt 0 ]; then" > $CVS_CO_DIR/root/.shrc
-echo " /etc/rc.initial" >> $CVS_CO_DIR/root/.shrc
-echo " exit" >> $CVS_CO_DIR/root/.shrc
-echo "fi" >> $CVS_CO_DIR/root/.shrc
-echo "if [ \`env | grep SSH_TTY | wc -l\` -gt 0 ] || [ \`env | grep cons25 | wc -l\` -gt 0 ]; then" >> $CVS_CO_DIR/root/.profile
-echo " /etc/rc.initial" >> $CVS_CO_DIR/root/.profile
-echo " exit" >> $CVS_CO_DIR/root/.profile
-echo "fi" >> $CVS_CO_DIR/root/.profile
+detect_command='[ -n "$SSH_TTY" -o "$TERM" = "cons25" ] && exec /etc/rc.initial'
+echo "$detect_command" > $CVS_CO_DIR/root/.shrc
+echo "$detect_command" >> $CVS_CO_DIR/root/.profile
# Now turn on or off serial console as needed
/tmp/post_upgrade_command.php $1
OpenPOWER on IntegriCloud