Skip to content

Satellite 5.x tags

A comma delimted file list hostname, application name and its owner or owners. For example

law1,KGB_Detector,James Bond/Gold Member
law2,KGB_Detector,James Bond/Gold Member
law3,KGB_Detector,James Bond/Gold Member

We need to simultaneously create and populate tags with the values from the provided data file (called DataFile.dat).

cat DataFile.dat | awk -F ',' '{print $1, $2, $3}' | while read client application owner
  Application=$(echo $application | sed -r 's/\s/\\ /')
  Owner=$(echo $owner | sed -r 's/\s/\\ /g')
  spacecmd -u satadmin -p K@rma0118 custominfo_createkey owner
  spacecmd -u satadmin -p K@rma0118 system_addcustomvalue owner $Owner $client
  spacecmd -u satadmin -p K@rma0118 custominfo_createkey application
  spacecmd -u satadmin -p K@rma0118 system_addcustomvalue application $Application $client

Keep in mind, it is an error to create an existing key…. So if you re-execute this scripts you will get errors.

Posted in LINUX.

Tagged with , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield

Copyright © 2016 - 2018 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.