Commit 3a58cbe3 authored by Adam Wujek's avatar Adam Wujek 💬

rootfs: use hostname as a prompt if available

Use hostname if available as a prompt instead of wrs-<IP_address>
When hostname is not availalble use wrs-<IP_address>
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 33df5835
...@@ -54,7 +54,13 @@ if [ "$PS1" ]; then ...@@ -54,7 +54,13 @@ if [ "$PS1" ]; then
alias bc='calc -Cd ' alias bc='calc -Cd '
fi; fi;
export PS1="wrs-`ifconfig eth0 | grep inet | awk -F: '{ print $2 }' | awk '{ print $1 }'`#" HOST_NAME=`/bin/hostname`
if [ "$HOST_NAME" != "(none)" ]; then
export PS1="$HOST_NAME#"
else
export PS1="wrs-`ifconfig eth0 | grep inet | awk -F: '{ print $2 }' | awk '{ print $1 }'`#"
fi
echo -n "dot-config status: " echo -n "dot-config status: "
if [ -f /tmp/dot-config_status ]; then if [ -f /tmp/dot-config_status ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment