Skip to main content
Solved

Different EA Results in JAMF than from Local Script


Forum|alt.badge.img+6

I am trying to identify the Apache2 version to scope systems that need an update, but I am experiencing some unexpected results. My EA script:

#!/bin/sh

result=`httpd -v | grep "Unix" | awk '{print $3}' | cut -f2 -d"/"`
echo "<result>$result</result>"

When I run as root on my test system, the result is what I expect to see:
<result>2.4.46</result>
But the EA result in JAMF pro is 2.4.41.

A few details that may help: 2.4.41 is the version that ships with 10.15. I am leveraging MacPorts for the Apache2 update to 2.4.46.

Any ideas are appreciated :)

Best answer by softpaw87

Thank you for the reply, and the more concise notation.

Yes, it looks like there are multiple versions installed. Running a quick

sudo find / -name "httpd" -exec sudo {} -v ; | awk '/Server version/{print substr($3,8)}'

showed me JAMF is running httpd located in /usr/sbin. Modified my script explicitly use /usr/local/bin/httpd, and its picking up 2.4.46 on my test machine.

Appreciate your input on this.

Working EA script:

#!/bin/sh


result="$(/usr/local/bin/httpd -v | awk '/Server version/{print substr($3,8)}')"
echo "<result>$result</result>"
View original
Did this topic help you find an answer to your question?

2 replies

brockwalters
Forum|alt.badge.img+8
  • Valued Contributor
  • 64 replies
  • March 4, 2021

1st of all:

result="$(httpd -v | awk '/Server version/{print substr($3,8)}')"

2nd: I believe it is highly likely you have 2 versions installed. Can you give anymore detail on the install? Thanks.


Forum|alt.badge.img+6
  • Author
  • New Contributor
  • 8 replies
  • Answer
  • March 5, 2021

Thank you for the reply, and the more concise notation.

Yes, it looks like there are multiple versions installed. Running a quick

sudo find / -name "httpd" -exec sudo {} -v ; | awk '/Server version/{print substr($3,8)}'

showed me JAMF is running httpd located in /usr/sbin. Modified my script explicitly use /usr/local/bin/httpd, and its picking up 2.4.46 on my test machine.

Appreciate your input on this.

Working EA script:

#!/bin/sh


result="$(/usr/local/bin/httpd -v | awk '/Server version/{print substr($3,8)}')"
echo "<result>$result</result>"

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings