cdist/bin/cdist-explore

20 lines
408 B
Text
Raw Normal View History

#!/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)"