mirror of
https://github.com/certbot/certbot.git
synced 2026-08-03 08:03:10 +02:00
Add Mac compatibility to boulder-start
The version of sort that ships with OS X does not support the -V version flag. Emulate that functionality with some sed-fu
This commit is contained in:
@@ -8,7 +8,12 @@ GOVER=`go version | cut -d" " -f3 | cut -do -f2`
|
||||
|
||||
# version comparison
|
||||
function verlte {
|
||||
if [ `uname` == 'Darwin' ]; then
|
||||
[ "$1" = "`echo -e \"$1\n$2\" | sed 's/\b\([0-9]\)\b/0\1/g' \
|
||||
| sort | sed 's/\b0\([0-9]\)/\1/g' | head -n1`" ]
|
||||
else
|
||||
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
|
||||
fi
|
||||
}
|
||||
|
||||
if ! verlte 1.5 "$GOVER" ; then
|
||||
|
||||
Reference in New Issue
Block a user