Permalink
Browse files

Begin 1.4.1->1.5 Migration, add Alias

  • Loading branch information...
NEMS Linux
NEMS Linux committed Oct 28, 2018
1 parent edb7a46 commit c0d4e29b48091b46a37b9d68aabe2c8cd015aca8
Showing with 15 additions and 1 deletion.
  1. +15 −1 info.sh
16 info.sh
@@ -194,7 +194,21 @@ elif [[ $COMMAND == "downtimes" ]]; then
/usr/local/share/nems/nems-scripts/info2.sh 6
elif [[ $COMMAND == "alias" ]]; then
hostname
# From nems.conf
if [[ -f /usr/local/share/nems/nems.conf ]]; then
if grep -q "alias" /usr/local/share/nems/nems.conf; then
username=`cat /usr/local/share/nems/nems.conf | grep alias | printf '%s ' $(cut -n -d '=' -f 2)`
fi
fi
# From hostname (if alias is not set)
if [[ $username == "" ]]; then
username=`hostname`
fi
# Fallback to the obvious
if [[ $username == "" ]]; then
username='NEMS'
fi
echo $username
elif [[ $COMMAND == "state" ]]; then
/usr/local/share/nems/nems-scripts/stats-livestatus-full.sh

0 comments on commit c0d4e29

Please sign in to comment.