jgstew / tools

various scripts and tools
MIT License
23 stars 14 forks source link

Client/Agent version download URLs are hardcoded (install_bigfix) #8

Closed jgstew closed 8 years ago

jgstew commented 8 years ago

Affected Files:

The download URLs are hardcoded and should instead use variables.

Example URLs:

http://software.bigfix.com/download/bes/95/BESAgent-9.5.2.56-rhe5.x86_64.rpm
http://software.bigfix.com/download/bes/95/BESAgent-9.5.2.56-debian6.amd64.deb
http://software.bigfix.com/download/bes/92/BESAgent-9.2.5.130-rhe5.i686.rpm
http://software.bigfix.com/download/bes/92/BigFix-BES-Client-9.2.5.130.exe
http://software.bigfix.com/download/bes/82/BigFix-BES-Client-8.2.1472.0.exe

How they should be: http://software.bigfix.com/download/bes/$URLMAJORMINOR/BESAgent-$URLVERSION-rhe5.$URLBITS.rpm


Related: http://unix.stackexchange.com/questions/82409/are-there-versions-of-unix-that-dont-have-awk-in-default-install

jgstew commented 8 years ago

$URLMAJORMINOR can be derived from $URLVERSION as follows:

echo $URLVERSION | awk '/./ {gsub(/\./, " "); print $1 $2}'

Sample output:

echo 9.5.2.56 | awk '/./ {gsub(/\./, " "); print $1 $2}'
95
jgstew commented 8 years ago

addressed here: https://github.com/jgstew/tools/commit/16e52858e30c0e2bbf55c97c2ed1396242addc2a