summaryrefslogtreecommitdiffstats
path: root/meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh')
-rw-r--r--meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh b/meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh
new file mode 100644
index 0000000..b819b6a
--- /dev/null
+++ b/meta-raptor/meta-asus/recipes-asus/fbutils/files/asus_us_mac.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+#
+# Copyright 2017 Raptor Engineering, LLC
+# Copyright 2015-present Facebook. All Rights Reserved.
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program in a file named COPYING; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301 USA
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+
+. /usr/local/bin/openbmc-utils.sh
+
+mac=$(fw_printenv ethaddr)
+
+if [ -n "$mac" -a "${mac/X/}" = "${mac}" ]; then
+ echo $mac
+ exit 0
+else
+ echo "Cannot determine BMC MAC" 1>&2
+ exit -1
+fi
OpenPOWER on IntegriCloud