From 7ad1b9c5ae6cb75f90dbfe0c8befdfee5993fe8f Mon Sep 17 00:00:00 2001 From: pexcn Date: Wed, 3 Feb 2021 02:41:02 +0800 Subject: [PATCH] scripts: add login banner & update PS1 copy from: https://github.com/hanwckf/rt-n56u/commit/2ee4773a9a593312bfc034266bd4e708517437aa https://github.com/hanwckf/rt-n56u/commit/c92ec9f24edbac3edc0387d0d63847062410d375 --- trunk/user/scripts/Makefile | 1 + trunk/user/scripts/banner | 6 ++++++ trunk/user/scripts/profile | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 trunk/user/scripts/banner diff --git a/trunk/user/scripts/Makefile b/trunk/user/scripts/Makefile index 39d3f4a8c7..1e3b08c300 100644 --- a/trunk/user/scripts/Makefile +++ b/trunk/user/scripts/Makefile @@ -21,5 +21,6 @@ endif $(ROMFSINST) /etc_ro/profile $(ROMFSINST) /etc_ro/shells $(ROMFSINST) /etc_ro/mdev.conf + $(ROMFSINST) /etc_ro/banner mkdir -p $(INSTALLDIR)/usr/share/terminfo tar -xzf ./terminfo.tar.gz -C $(INSTALLDIR)/usr/share diff --git a/trunk/user/scripts/banner b/trunk/user/scripts/banner new file mode 100644 index 0000000000..985645adae --- /dev/null +++ b/trunk/user/scripts/banner @@ -0,0 +1,6 @@ + ____ __ + / __ \____ _____/ /___ __ ______ _____ + / /_/ / __ `/ __ / __ `/ | / / __ `/ __ \ + / ____/ /_/ / /_/ / /_/ /| |/ / /_/ / / / / +/_/ \__,_/\__,_/\__,_/ |___/\__,_/_/ /_/ + diff --git a/trunk/user/scripts/profile b/trunk/user/scripts/profile index abfe7e846d..6cae9d287d 100644 --- a/trunk/user/scripts/profile +++ b/trunk/user/scripts/profile @@ -2,12 +2,13 @@ # If running interactively, then if [ "$PS1" ] ; then - + export PS1='\h:\w \$ ' export PATH=/opt/sbin:/opt/bin:/usr/sbin:/usr/bin:/sbin:/bin export HOSTNAME=`/bin/hostname` export TERMINFO=/usr/share/terminfo export TERM=xterm - + [ -r /etc_ro/banner ] && cat /etc_ro/banner + echo "Version: $(nvram get firmver_sub)"; echo "" fi; [ -r /opt/etc/profile ] && . /opt/etc/profile