Posted on 03-03-2021 11:58 AM
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 :)
Solved! Go to Solution.
Posted on 03-05-2021 09:12 AM
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>"
Posted on 03-04-2021 01:01 PM
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.
Posted on 03-05-2021 09:12 AM
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>"