Commit 984e0dc8 authored by ssrq's avatar ssrq

[explorer/os_release] Add fallbacks to /usr/lib/os-release and /var/run/os-release

parent 0f420993
#!/bin/sh #!/bin/sh
# #
# 2018 Adam Dej (dejko.a at gmail.com) # 2018 Adam Dej (dejko.a at gmail.com)
# 2020 Dennis Camera (dennis.camera at ssrq-sds-fds.ch)
# #
# This file is part of cdist. # This file is part of cdist.
# #
...@@ -21,6 +22,17 @@ ...@@ -21,6 +22,17 @@
# See os-release(5) and http://0pointer.de/blog/projects/os-release # See os-release(5) and http://0pointer.de/blog/projects/os-release
set +e if test -f /etc/os-release
then
# Linux and FreeBSD (usually a symlink)
cat /etc/os-release
elif test -f /usr/lib/os-release
then
# systemd
cat /usr/lib/os-release
elif test -f /var/run/os-release
then
# FreeBSD (created by os-release service)
cat /var/run/os-release
fi
cat /etc/os-release || cat /usr/lib/os-release || true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment