Skip to main content
Solved

Extension script problem

  • February 12, 2015
  • 2 replies
  • 14 views

Forum|alt.badge.img+17

I've written an extension to basically grep the number from the name of a text file we used in our old imaging method to keep track of the image version installed on machines.

The file is /Restore/ Image Version 6.5.3.txt (Note the space at the beginning of the file, and we used RTF at one point in time and switched to TXT).

The script works on it's own, but no results are returned from the extension. the script is...

#!/bin/bash
Filename=`ls /Restore/ Im*`
        if [ -z "$Filename" ]; then
                Bar="N/A"
        else
                Foo=${Filename#/Restore/ Image Version }
                Bar=${Foo%.*}
        fi
echo $Bar

The data type is set to string, the inventory display is set to Extension attributes.

Is there a place to look and see the results of extensions so I can see what the problem is?

Best answer by rlandgraf

You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.

2 replies

Forum|alt.badge.img+14
  • Contributor
  • Answer
  • February 12, 2015

You need to echo the results with echo "<result>$Bar</result>" in order for it to show up in extension attributes.


Forum|alt.badge.img+17
  • Author
  • Valued Contributor
  • February 13, 2015

Yep. That was it. D'oh! :-)