- 积分
- 4
- 威望
-
- 金钱
-
- 注册时间
- 2016-5-7
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2016-5-8 09:12:18
|
显示全部楼层
修改一个独立脚本 install_mariadb.sh
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# Check if user is root
if [ $(id -u) != "0" ]; then
echo "Error: You must be root to run this script, please use root to install lnmp"
exit 1
fi
cur_dir=$(pwd)
Stack=$1
if [ "${Stack}" = "" ]; then
Stack="lnmp"
else
Stack=$1
fi
LNMP_Ver='1.2'
. include/main.sh
. include/init.sh
. include/mysql.sh
. include/mariadb.sh
. include/end.sh
Get_Dist_Name
if [ "${DISTRO}" = "unknow" ]; then
Echo_Red "Unable to get Linux distribution name, or do NOT support the current distribution."
exit 1
fi
clear
echo "+------------------------------------------------------------------------+"
echo "| LNMP V${LNMP_Ver} for ${DISTRO} Linux Server, Written by Licess |"
echo "+------------------------------------------------------------------------+"
echo "| A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux |"
echo "+------------------------------------------------------------------------+"
echo "| For more information please visit http://www.lnmp.org |"
echo "+------------------------------------------------------------------------+"
Init_Install()
{
Press_Install
Print_Sys_Info
Disable_Selinux
Install_MariaDB_10
}
LNMP_Stack()
{
Init_Install
Check_LNMP_Install
}
LNMPA_Stack()
{
Init_Install
Check_LNMPA_Install
}
LAMP_Stack()
{
Init_Install
Check_LAMP_Install
}
case "${Stack}" in
lnmp)
Dispaly_Selection
LNMP_Stack 2>&1 | tee -a /root/lnmp-install.log
;;
lnmpa)
Dispaly_Selection
LNMPA_Stack 2>&1 | tee -a /root/lnmp-install.log
;;
lamp)
Dispaly_Selection
LAMP_Stack 2>&1 | tee -a /root/lnmp-install.log
;;
*)
Echo_Red "Usage: $0 {lnmp|lnmpa|lamp}"
;;
esac |
|