代码拉取完成,页面将自动刷新
同步操作将从 Hailiang/lnmp 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
. include/common.sh
echo -e "$GREEN"
clear
echo -e "${GREEN}
#####################################################################
# LNMP is a bash script for the installation of Nginx + PHP + MySQL.#
# Author Hehl <[email protected]> #
# Blog Http://www.yunweijilu.com #
# Auto backup or inport Mysql Sql file to Mysql server #
#####################################################################
"
#Mysql SQL Data backup
mysql_sql_back(){
if [[ ! -d ${data_backup_dir} ]] ; then
mkdir -p $data_backup_dir
echo -e " \033[32mCreat $data_backup_dir Successful! \033[0m"
fi
if [ `ps aux | grep mysql|grep -v grep|wc -l` -eq "0" ];then
/etc/init.d/mysqld start
fi
$MYSQLDUMP -u$MYSQLUSR -p"$mysql_root_pass" --all-databases > $mysql_data_backup
if [[ $? -eq 0 ]];then
echo -e " \033[32m Backup Mysql Data success! \033[0m"
else
echo -e " \033[32m Back failed,pls check...\033[0m "
fi
}
#Mysql SQL Data import
mysql_sql_import(){
$mysql_cmd -u"$MYSQLUSR" -p"$mysql_root_pass" < $mysql_data_backup
}
#Mysql backup or import Menu
[ ! -d $mysql_local ] && echo -e "${RED}No Mysql Server in your System!!" && exit 1
if [ -z $1 ];then
echo -e "${WHITE}Usage {$0 backup|import}${WHITE}"
echo
else
echo -e "${YELLOW}"
read -p "Please input Mysql server root password : " mysql_root_pass
if [ $1 == "backup" ];then
echo -e "You select backup Mysql Data from $mysql_data"
mysql_sql_back
elif [ $1 == "import" ];then
echo -e "You select import Mysql Data to $data_backup_dir"
mysql_sql_import
else
echo -e "Usage {$0 backup|import}"
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。