Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ncharles committed Aug 31, 2019
1 parent 4a5c037 commit f581b52
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions contrib/inventory-generation/inventory-generation
Expand Up @@ -25,6 +25,8 @@ WIPE=false
TEMPLATE=tml.ocs
DEST_PATH=data

DEST_INVENTORIES=inventories

# detect if any option has been passed to the script
ANY_OPTION_DEFINED=false

Expand Down Expand Up @@ -98,7 +100,24 @@ function generate_data {

}

function create_inventory {
mkdir ${INVENTORIES}

echo "Creating inventories based on the folders in ${DEST_PATH}"

# List all uuids
for d in ${DEST_PATH}/*/ ; do
UUID=$d

# read variables
IP=$(<${DEST_PATH}/$d/ip)
MAC=$(<${DEST_PATH}/$d/mac)
OS_NAME=$(<${DEST_PATH}/$d/osname)
FULL_OS_NAME=$(<${DEST_PATH}/$d/fullosname)
AGENT_VERSION=$(<${DEST_PATH}/$d/agent_version)
done

}
function wipe {
echo "Wipping folder ${DEST_PATH}"
echo "Type ctrl-c to abort now and return to continue."
Expand Down

0 comments on commit f581b52

Please sign in to comment.