add os detection for debian and archlinux

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2010-09-16 02:54:36 +02:00
parent d5561858fc
commit a5a12c72b1

17
bin/cdist-explore Executable file
View file

@ -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)"