summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangshunjian <[email protected]>2018-10-18 16:03:04 +0800
committerfangshunjian <[email protected]>2018-10-18 16:03:04 +0800
commit4e1c230d8842949f3f5bf8750712ed9212d9ae6f (patch)
tree93020b122ef5cd139c2fdfcd9232121dce1377f7
parent2aa74c2eb9fca905095769b9599cae97dc20917e (diff)
parentf4ae72e55c69651e71fbbc8776034a883223d818 (diff)
Merge remote-tracking branch 'origin/dev' into dev
-rw-r--r--linuxinstall/shell/nmsagent.sh14
1 files changed, 12 insertions, 2 deletions
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" : '.*-> \(.*\)$'`