forked from opencomputeproject/onie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onie-version
executable file
·23 lines (18 loc) · 741 Bytes
/
onie-version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# Copyright (C) 2015 Curt Brune <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0
# This script is part of the onie-tools package, intended for use by a
# NOS to display information about the ONIE environment. The script
# leverages the ONIE build information from the grub-machine.cfg file.
grub_dir="$(dirname $(realpath $0))/../../grub"
grub_machine_cfg="${grub_dir}/grub-machine.cfg"
if [ -r "$grub_machine_cfg" ] ; then
. "$grub_machine_cfg"
grep = $grub_machine_cfg | sed -e 's/onie_//' -e 's/=.*$//' | while read var ; do
eval val='$'onie_$var
printf "%-20s: %s\n" "ONIE ${var}" "$val"
done
else
echo "Warning: ONIE version information not available" > /dev/stderr
fi