Support unknown manufacturers in MOTD
This commit is contained in:
parent
55ec177919
commit
894ce9b517
|
@ -18,9 +18,11 @@ else
|
||||||
echo >> $TMPFILE
|
echo >> $TMPFILE
|
||||||
fi
|
fi
|
||||||
# Get machine information
|
# Get machine information
|
||||||
echo "> \033[1;37mPVC node\033[0m on \033[1;31m$(
|
MANUFACTURER="$( /usr/sbin/dmidecode | grep -A1 'Chassis Information' | tail -1 | awk -F':' '{print $2}' | tr -s ' ' )"
|
||||||
/usr/sbin/dmidecode | grep -A1 'Chassis Information' | tail -1 | awk -F':' '{print $2}' | tr -s ' '
|
if [[ -z ${MANUFACTURER} ]]; then
|
||||||
)\033[0m hardware" >> $TMPFILE
|
MANUFACTURER='Unknown'
|
||||||
|
fi
|
||||||
|
echo "> \033[1;37mPVC node\033[0m on \033[1;31m${MANUFACTURER}\033[0m hardware" >> $TMPFILE
|
||||||
echo "> $(/bin/uname -srvmo)" >> $TMPFILE
|
echo "> $(/bin/uname -srvmo)" >> $TMPFILE
|
||||||
|
|
||||||
mv $TMPFILE $TGTFILE || rm $TMPFILE
|
mv $TMPFILE $TGTFILE || rm $TMPFILE
|
||||||
|
|
Loading…
Reference in New Issue