Merge pull request #555 from uqam-fob/explorer-os-etc-os-release
explorer/os: get ID from /etc/os-release
This commit is contained in:
commit
d3b4a5b2c1
1 changed files with 8 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
|
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
|
||||||
|
# Copyright 2017, Philippe Gregoire <pg@pgregoire.xyz>
|
||||||
#
|
#
|
||||||
# This file is part of cdist.
|
# This file is part of cdist.
|
||||||
#
|
#
|
||||||
|
@ -139,5 +140,12 @@ case "$uname_s" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
# already lowercase, according to:
|
||||||
|
# https://www.freedesktop.org/software/systemd/man/os-release.html
|
||||||
|
awk -F= '/^ID=/ {print $2;}' /etc/os-release
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Unknown OS" >&2
|
echo "Unknown OS" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue