#!/bin/bash

command=`which facter`
echo "<<<facter>>>"
if [ -e "$command" ]
then
    version=`facter --version | cut -d '.' -f 1`
    if [ $version -ge 2 ]
    then
        $command --json 2>/dev/null | tr -d " \t\n"
    else
        $command --json 2>/dev/null | tr -d " \t"
    fi
    echo ""
else
    echo "facter_not_installed"
fi

