forked from ungleich-public/cdist
01ef65fbaa
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
19 lines
408 B
Bash
Executable file
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)"
|