summaryrefslogtreecommitdiffstats
path: root/src/collectd/snmp_mib_config.sh
diff options
context:
space:
mode:
authorMaryam Tahhan <maryam.tahhan@intel.com>2017-10-24 15:21:40 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2017-10-24 15:37:37 +0100
commitecf1ba1c5000718d1f0d90270af33039b488c835 (patch)
treed27ce2622523ec0097c9d3c04a48984ed507a5ba /src/collectd/snmp_mib_config.sh
parent787c0f30f5027ac3d072f0c5e53f970d8273e3ac (diff)
src: fix src build issues
Change-Id: I8abf40a0034110dc504c227ffba1ff5e9ec6850b Signed-off-by: Maryam Tahhan <maryam.tahhan@intel.com> Signed-off-by: Taras Chornyi <tarasx.chornyi@intel.com>
Diffstat (limited to 'src/collectd/snmp_mib_config.sh')
-rwxr-xr-xsrc/collectd/snmp_mib_config.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/collectd/snmp_mib_config.sh b/src/collectd/snmp_mib_config.sh
index 179eb4ba..a2c44db1 100755
--- a/src/collectd/snmp_mib_config.sh
+++ b/src/collectd/snmp_mib_config.sh
@@ -17,8 +17,14 @@ export CURRENT_DIR=$(pwd)
cp $CURRENT_DIR/../../mibs/* /usr/share/snmp/mibs/
-if [ -n "$(uname -a | grep Ubuntu)" ]; then
+# Detect OS name and version from systemd based os-release file
+. /etc/os-release
+
+# Get OS name (the First word from $NAME in /etc/os-release)
+OS_NAME="$ID"
+
+if [ "x$OS_NAME" == "xubuntu" ]; then
cp $CURRENT_DIR/../../mibs/* /var/lib/mibs/ietf/
-else
+elif [ "x${OS_NAME}" == "xfedora" ]; then
cp $CURRENT_DIR/../../mibs/* /usr/share/mibs/ietf/
fi