#!/bin/sh
#
#    Copyright (c) 2001 Brocade Communications Systems, Inc.
#    All rights reserved.
#
#    File name:   uptim 
#    Module name: fabos/src/utils/sys
#
#    This script is wrapper to the traditional /usr/bin/uptime command 
#    so that /fabos/bin/ will contain this wrapper to allow all accounts to use it.
#
#	 	 

#   Uptime O/P for Skybolt setup displays 24hrs time along with am and pm which needs to be trimmed,
#   to make the O/P look similar to other switches.Following Script checks for the O/P of Uptime command,
#   if the o/p has am/pm it will be trimmed and rest of the o/p will be displayed.


export PATH=/usr/bin
UP_TIME=`/usr/bin/uptime`

FIELD1=`echo $UP_TIME| cut -d'.' -f1`
FIELD2=`echo $UP_TIME| cut -d'.' -f2`
FIELD3=`echo $UP_TIME| cut -d'.' -f3`
FIELD4=`echo $UP_TIME| cut -d'.' -f4`

if [ ${FIELD1:5:2} = "am" ] || [ ${FIELD1:5:2} = "pm" ]; then
	FIELD1="${FIELD1:0:5} ${FIELD1:8}"
fi

echo " $FIELD1.$FIELD2.$FIELD3.$FIELD4"
