File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 31
31
# find the openresty
32
32
OR_BIN=$( command -v openresty || exit 1)
33
33
OR_EXEC=${OR_BIN:- ' /usr/local/openresty-debug/bin/openresty' }
34
- OR_VER=$( openresty -v 2>&1 | awk -F ' /' ' {print $2}' | awk -F ' .' ' {print $1"." $2}' )
34
+ OR_VER=$( openresty -v 2>&1 | awk -F ' /' ' {print $2}' | awk -F ' .' ' {print $1 * 100 + $2}' )
35
35
LUA_VERSION=$( lua -v 2>&1 | grep -E -o " Lua [0-9]+.[0-9]+" )
36
36
37
- if [[ -e $OR_EXEC && " $OR_VER " =~ " 1.19 " ]]; then
38
- # OpenResty version is 1.19, use luajit by default
37
+ if [[ -e $OR_EXEC && " $OR_VER " -ge 119 ]]; then
38
+ # OpenResty version is >= 1.19, use luajit by default
39
39
# find the luajit binary of openresty
40
40
LUAJIT_BIN=$( ${OR_EXEC} -V 2>&1 | grep prefix | grep -Eo ' prefix=(.*)/nginx\s+--' | grep -Eo ' /.*/' ) luajit/bin/luajit
41
41
42
42
# use the luajit of openresty
43
43
echo " $LUAJIT_BIN $APISIX_LUA $* "
44
44
exec $LUAJIT_BIN $APISIX_LUA $*
45
45
elif [[ " $LUA_VERSION " =~ " Lua 5.1" ]]; then
46
- # OpenResty version is not 1.19, use Lua 5.1 by default
46
+ # OpenResty version is < 1.19, use Lua 5.1 by default
47
47
echo " lua $APISIX_LUA $* "
48
48
exec lua $APISIX_LUA $*
49
49
else
50
- echo " ERROR: Please check the version of OpenResty and Lua, OpenResty 1.19 + LuaJIT or OpenResty before 1.19 + Lua 5.1 is required for Apache APISIX."
50
+ echo " ERROR: Please check the version of OpenResty and Lua, OpenResty 1.19+ + LuaJIT or OpenResty before 1.19 + Lua 5.1 is required for Apache APISIX."
51
51
fi
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ rm -f v"$LUAROCKS_VER".tar.gz
29
29
cd luarocks-" $LUAROCKS_VER " || exit
30
30
31
31
OR_BIN=" $OPENRESTY_PREFIX /bin/openresty"
32
- OR_VER=$( $OR_BIN -v 2>&1 | awk -F ' /' ' {print $2}' | awk -F ' .' ' {print $1"." $2}' )
33
- if [[ -e $OR_BIN && " $OR_VER " == 1.19 ]]; then
32
+ OR_VER=$( $OR_BIN -v 2>&1 | awk -F ' /' ' {print $2}' | awk -F ' .' ' {print $1 * 100 + $2}' )
33
+ if [[ -e $OR_BIN && " $OR_VER " -ge 119 ]]; then
34
34
WITH_LUA_OPT=" --with-lua=${OPENRESTY_PREFIX} /luajit"
35
35
else
36
36
# For old version OpenResty, we still need to install LuaRocks with Lua
You can’t perform that action at this time.
0 commit comments