diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2010-12-05 16:58:50 -0600 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2010-12-05 16:58:50 -0600 |
commit | cbc2d9dde1fbd89727d64e2544b88e433edde919 (patch) | |
tree | 6e847e6a6c40347dbc2793b825dcb8b047374193 /doc | |
parent | 165f426083778303fcd2ee4d3fd697571de2867a (diff) | |
parent | 0cff753190c235a9ce65a920730d715a5e4a8ed4 (diff) | |
download | bcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.tar.gz bcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.tar.bz2 bcfg2-cbc2d9dde1fbd89727d64e2544b88e433edde919.zip |
Merge branch 'master' into docs
Diffstat (limited to 'doc')
-rw-r--r-- | doc/server/configurationentries.txt | 6 | ||||
-rw-r--r-- | doc/server/plugins/probes/group.txt | 58 |
2 files changed, 36 insertions, 28 deletions
diff --git a/doc/server/configurationentries.txt b/doc/server/configurationentries.txt index 1146a51c6..8741e56f5 100644 --- a/doc/server/configurationentries.txt +++ b/doc/server/configurationentries.txt @@ -5,10 +5,10 @@ .. _Base: plugins/structures/base .. _Bundler: plugins/structures/bundler -.. _Cfg: plugins/generators/cfg +.. _Cfg: plugins/generators/cfg.html .. _TGenshi: plugins/generators/tgenshi -.. _TCheetah: plugins/generators/tcheetah -.. _Rules: plugins/generators/rules +.. _TCheetah: plugins/generators/tcheetah.html +.. _Rules: plugins/generators/rules.html .. _server-configurationentries: diff --git a/doc/server/plugins/probes/group.txt b/doc/server/plugins/probes/group.txt index 13b0d12eb..f529b8b3e 100644 --- a/doc/server/plugins/probes/group.txt +++ b/doc/server/plugins/probes/group.txt @@ -20,57 +20,65 @@ Probe used to dynamically set client groups based on OS/distro. if [ -e /etc/release ]; then # Solaris - OUTPUT=$OUTPUT'\n'`echo group:solaris` + OUTPUT="$OUTPUT\ngroup:solaris" elif [ -e /etc/debian_version ]; then # debian based - OUTPUT=$OUTPUT'\n'`echo group:deb` + OUTPUT="$OUTPUT\ngroup:deb" if [ -e /etc/lsb-release ]; then # variant . /etc/lsb-release OS_GROUP=$DISTRIB_CODENAME - DEBIAN_VERSION=$(echo "$DISTRIB_ID" | tr '[A-Z' '[a-z]') + DEBIAN_VERSION=$(echo "$DISTRIB_ID" | tr '[A-Z]' '[a-z]') case "$OS_GROUP" in "lucid") - OUTPUT=$OUTPUT'\n'`echo group:$DISTRIB_CODENAME` - OUTPUT=$OUTPUT'\n'`echo group:$DEBIAN_VERSION` + OUTPUT="$OUTPUT\ngroup:${DISTRIB_CODENAME}" + OUTPUT="$OUTPUT\ngroup:${DEBIAN_VERSION}" ;; esac else # debian OS_GROUP=`cat /etc/debian_version` - OUTPUT=$OUTPUT'\n'`echo group:debian` + OUTPUT="$OUTPUT\ngroup:debian" case "$OS_GROUP" in 5.*) - OUTPUT=$OUTPUT'\n'`echo group:lenny` + OUTPUT="$OUTPUT\ngroup:lenny" ;; "sid") - OUTPUT=$OUTPUT'\n'`echo group:sid` + OUTPUT="$OUTPUT\ngroup:sid" ;; esac fi elif [ -e /etc/redhat-release ]; then # redhat based - OUTPUT=$OUTPUT'\n'`echo group:rpm` - OS_GROUP=`cat /etc/redhat-release | cut -d' ' -f1 | tr '[A-Z]' '[a-z]'` - REDHAT_VERSION=`cat /etc/redhat-release | cut -d' ' -f3` - case "$OS_GROUP" in - "centos" | "fedora") - OUTPUT=$OUTPUT'\n'`echo group:$OS_GROUP` - OUTPUT=$OUTPUT'\n'`echo group:$OS_GROUP$REDHAT_VERSION` - ;; - esac + if [ -x /bin/rpm ]; then + OUTPUT="${OUTPUT}\ngroup:rpm" + OS_GROUP=`bin/rpm -q --qf "%{NAME}" --whatprovides redhat-release | sed 's/-release.*//' | tr '[A-Z]' '[a-z]'` + REDHAT_VERSION=`bin/rpm -q --qf "%{VERSION}" --whatprovides redhat-release` + case "$OS_GROUP" in + "centos" | "fedora") + OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}" + OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_VERSION}" + ;; + "redhat") + REDHAT_RELEASE=`bin/rpm -q --qf "%{RELEASE}" --whatprovides redhat-release| cut -d. -f1` + OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}" + OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_VERSION}" + OUTPUT="${OUTPUT}\ngroup:${OS_GROUP}-${REDHAT_RELEASE}" + ;; + esac + fi elif [ -e /etc/gentoo-release ]; then # gentoo - OUTPUT=$OUTPUT'\n'`echo group:gentoo` + OUTPUT="$OUTPUT\ngroup:gentoo" elif [ -x /usr/sbin/system_profiler ]; then # os x ### NOTE: Think about using system_profiler SPSoftwareDataType here - OUTPUT=$OUTPUT'\n'`echo group:osx` + OUTPUT="$OUTPUT\ngroup:osx" OSX_VERSION=`sw_vers | grep 'ProductVersion:' | egrep -o '[0-9]+\.[0-9]+'` if [ "$OSX_VERSION" == "10.6" ]; then - OUTPUT=$OUTPUT'\n'`echo group:osx-snow` + OUTPUT="$OUTPUT\ngroup:osx-snow" elif [ "$OSX_VERSION" == "10.5" ]; then - OUTPUT=$OUTPUT'\n'`echo group:osx-leo` + OUTPUT="$OUTPUT\ngroup:osx-leo" fi echo $OUTPUT else @@ -81,16 +89,16 @@ Probe used to dynamically set client groups based on OS/distro. case "$ARCH" in "x86_64") if [ "$OS_GROUP" == 'centos' ]; then - OUTPUT=$OUTPUT'\n'`echo group:$ARCH` + OUTPUT="$OUTPUT\ngroup:${ARCH}" else - OUTPUT=$OUTPUT'\n'`echo group:amd64` + OUTPUT="$OUTPUT\ngroup:amd64" fi ;; "i386" | "i686") - OUTPUT=$OUTPUT'\n'`echo group:i386` + OUTPUT="$OUTPUT\ngroup:i386" ;; "sparc64") - OUTPUT=$OUTPUT'\n'`echo group:sparc64` + OUTPUT="$OUTPUT\ngroup:sparc64" ;; esac |