mdserver-web/plugins/redis/install.sh

43 lines
796 B
Bash
Raw Normal View History

2018-11-05 06:05:33 -05:00
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
2018-11-05 10:42:01 -05:00
Install_redis()
2018-11-05 06:05:33 -05:00
{
2018-11-20 04:43:29 -05:00
2018-11-05 06:05:33 -05:00
echo '正在安装脚本文件...' > $install_tmp
2018-11-20 04:43:29 -05:00
wget -O $serverPath/tmp/redis.tar.gz http://download.redis.io/releases/redis-4.0.11.tar.gz
cd $serverPath/tmp && tar -zxvf redis.tar.gz
mkdir -p $serverPath/redis
cd redis* && make PREFIX=$serverPath/redis install
sed '/^ *#/d' redis.conf > $serverPath/redis/redis.conf
2018-11-05 06:05:33 -05:00
echo '安装完成' > $install_tmp
2018-11-20 04:43:29 -05:00
2018-11-21 05:18:17 -05:00
rm -rf $serverPath/tmp
2018-11-05 06:05:33 -05:00
}
2018-11-05 10:42:01 -05:00
Uninstall_redis()
2018-11-05 06:05:33 -05:00
{
2018-11-05 10:42:01 -05:00
echo "Uninstall_redis"
2018-11-05 06:05:33 -05:00
}
action=$1
if [ "${1}" == 'install' ];then
2018-11-05 10:42:01 -05:00
Install_redis
2018-11-05 06:05:33 -05:00
else
2018-11-05 10:42:01 -05:00
Uninstall_redis
2018-11-05 06:05:33 -05:00
fi