cdist/bin/cdist-explore
Nico Schottelius 01ef65fbaa output ideas
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
2010-09-16 03:00:02 +02:00

19 lines
408 B
Bash
Executable file

#!/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
}
# could work, if cdist_explore_os would be a different program
# nope, does not work, set -x output is not sourcable...
[ "$1" = "-o" ] && set -x
CDIST_OS="$(cdist_explore_os)"