From adde0086aa738bd30544c76671a2ccbefe52d03c Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Sun, 19 Nov 2023 21:02:31 +0800 Subject: [PATCH] Create libedit.sh --- plugins/php/lib/libedit.sh | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 plugins/php/lib/libedit.sh diff --git a/plugins/php/lib/libedit.sh b/plugins/php/lib/libedit.sh new file mode 100644 index 000000000..c9e742a93 --- /dev/null +++ b/plugins/php/lib/libedit.sh @@ -0,0 +1,45 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +# cd /www/server/mdserver-web/plugins/php/lib && bash libedit.sh + +# echo $rootPath + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib + + +# LOCAL_ADDR=common +# cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +# if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then +# LOCAL_ADDR=cn +# fi + +if [ ! -d ${SERVER_ROOT}/libiconv ];then + cd $SOURCE_ROOT + + VERSION="20230828-3.1" + + if [ ! -f ${SOURCE_ROOT}/libedit-${VERSION}.tar.gz ];then + wget --no-check-certificate -O ${SOURCE_ROOT}/libedit-${VERSION}.tar.gz https://thrysoee.dk/editline/libedit-${VERSION}.tar.gz + fi + + if [ ! -d ${SOURCE_ROOT}/libedit-${VERSION} ];then + cd $SOURCE_ROOT && tar -zxvf libedit-${VERSION}.tar.gz + fi + + cd ${SOURCE_ROOT}/libedit-${VERSION} + + ./configure --prefix=${SERVER_ROOT}/libedit && make && make install + + if [ -d $SOURCE_ROOT/libedit-${VERSION} ];then + cd $SOURCE_ROOT && rm -rf $SOURCE_ROOT/libedit-${VERSION} + fi +fi \ No newline at end of file