diff --git a/linuxinstall/shell/nmsagent.sh b/linuxinstall/shell/nmsagent.sh index 9450828..385a424 100644 --- a/linuxinstall/shell/nmsagent.sh +++ b/linuxinstall/shell/nmsagent.sh @@ -21,8 +21,18 @@ # resolve links - $0 may be a softlink PRG="$0" -#OS_TYPE=$( lsb_release -d| cut -d: -f2| cut -f2 ) -#echo $OS_TYPE +if [ -f /etc/redhat-release ]; then + OS_TYPE=`cat /etc/redhat-release` +else + islsb=`which lsb_release | wc -l` + if [ "$islsb" != "0" ]; then + OS_TYPE=$( lsb_release -d| cut -d: -f2| cut -f2 ) + else + OS_TYPE=`uname -a | awk '{print $1" "$2" "$3}'` + fi +fi +echo $OS_TYPE + while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'`