From 433d744953fa800ce49fa060b141c10663c0b952 Mon Sep 17 00:00:00 2001 From: Jason Cheng <30381035+jasoncheng7115@users.noreply.github.com> Date: Sun, 16 Dec 2018 22:21:00 +0800 Subject: [PATCH] Added FreeNAS Version support (#215) Hi, I added FreeNAS version information support, as shown in the figure: ![2018-12-15 11 53 31](https://user-images.githubusercontent.com/30381035/50044886-2329a580-00c5-11e9-817c-b89a8374270d.png) ![2018-12-15 11 53 49](https://user-images.githubusercontent.com/30381035/50044887-2329a580-00c5-11e9-93b4-b140809f84a3.png) --- snmp/distro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/snmp/distro b/snmp/distro index 0d6578c..9f1e9d4 100755 --- a/snmp/distro +++ b/snmp/distro @@ -125,7 +125,12 @@ elif [ "${OS}" = "Darwin" ] ; then fi elif [ "${OS}" = "FreeBSD" ] ; then - OSSTR=`/usr/bin/uname -mior` + DIST=$(cat /etc/version | cut -d'-' -f 1) + if [ "${DIST}" = "FreeNAS" ]; then + OSSTR=`cat /etc/version | cut -d' ' -f 1` + else + OSSTR=`/usr/bin/uname -mior` + fi fi echo ${OSSTR}