Update nmsagent.sh
加强 OS_TYPE 读取方式
This commit is contained in:
@@ -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" : '.*-> \(.*\)$'`
|
||||
|
||||
Reference in New Issue
Block a user