Update nmsagent.sh
加强 OS_TYPE 读取方式
This commit is contained in:
@@ -21,8 +21,18 @@
|
|||||||
# resolve links - $0 may be a softlink
|
# resolve links - $0 may be a softlink
|
||||||
PRG="$0"
|
PRG="$0"
|
||||||
|
|
||||||
#OS_TYPE=$( lsb_release -d| cut -d: -f2| cut -f2 )
|
if [ -f /etc/redhat-release ]; then
|
||||||
#echo $OS_TYPE
|
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
|
while [ -h "$PRG" ]; do
|
||||||
ls=`ls -ld "$PRG"`
|
ls=`ls -ld "$PRG"`
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
|||||||
Reference in New Issue
Block a user