From a5a12c72b1cc4c24c3df2ae4ed82eadd027c5f65 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 16 Sep 2010 02:54:36 +0200 Subject: [PATCH] add os detection for debian and archlinux Signed-off-by: Nico Schottelius --- bin/cdist-explore | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/cdist-explore diff --git a/bin/cdist-explore b/bin/cdist-explore new file mode 100755 index 00000000..76f838ff --- /dev/null +++ b/bin/cdist-explore @@ -0,0 +1,17 @@ +#!/bin/sh +# output or sourcable + +# OS +cdist_explore_os() +{ + [ -f /etc/arch-release ] && echo archlinux + + [ -f /etc/debian_version ] && echo debian + + grep -q ^DISTRIB_ID=Ubuntu /etc/lsb-release 2>/dev/null && echo ubuntu + +} + +# join those two if output needed +cdist_explore_os +CDIST_OS="$(cdist_explore_os)"