#!bin/sh
#vps wordpress一键重新安装脚本
#global setting
USERNAME="root" #数据库用户名
PASSWORD="ksharpdabu.info" #数据库密码
DBNAME="wordpress" #要导入的数据库名
BACKUPSQL="/home/ksharpdabu.sql" #备份的sql文件绝对路径
OLD_WP-CONFIG="/home/wp-config.php" #以前保存到wp-config.php文件的绝对路径
#setting end!!
WEBROOT="/home/wwwroot" #网站根目录http://www.dabu.info/?p=4329
echo "###################################################################\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "###################################################################\n"
get_char() #这一段的代码其实的功能就是让用户输入任意键以继续执行脚本,是常用的代码段
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "Press any key to start..."
char=`get_char`
create_db="create database IF NOT EXISTS ${DBNAME}"
mysql -u${USERNAME} -p${PASSWORD} -e "${create_db}" #创建名为wordpress的数据库,如果不存在http://www.dabu.info/?p=4329
wget -c http:#cn.wordpress.org/wordpress-3.7.1-zh_CN.zip #下载wordpress网站程序
unzip wordpress-3.7.1-zh_CN.zip #解压wordpress程序
cd wordpress #切换到解压后的wordpress目录
cp ./* ${WEBROOT} #将网站程序复制到网站根目录
\cp ${OLD_WP-CONFIG} ${WEBROOT} #将原先的wordpress的配置文件wp-config.php放到网站根目录
mysql -u${USERNAME} -p${PASSWORD} ${DBNAME} <${BACKUPSQL} #导入你备份的数据库到wordpress数据库里
echo "###################################################################\n"
echo "please view you blog to check the success or failure.\n"
echo "view my blog:http://www.dabu.info/ if you have question!!\n"
echo "###################################################################\n"
#!bin/sh
#vps wordpress一键重新安装脚本
#global setting
USERNAME="root" #数据库用户名
PASSWORD="ksharpdabu.info" #数据库密码
DBNAME="wordpress" #要导入的数据库名
BACKUPSQL="/home/ksharpdabu.sql" #备份的sql文件绝对路径
OLD_WP-CONFIG="/home/wp-config.php" #以前保存到wp-config.php文件的绝对路径
#setting end!!
WEBROOT="/home/wwwroot" #网站根目录http://www.dabu.info/?p=4329
echo "###################################################################\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "please backup your website data when you run this shell script!!!!\n"
echo "###################################################################\n"
get_char() #这一段的代码其实的功能就是让用户输入任意键以继续执行脚本,是常用的代码段
{
SAVEDSTTY=`stty -g`
stty -echo
stty cbreak
dd if=/dev/tty bs=1 count=1 2> /dev/null
stty -raw
stty echo
stty $SAVEDSTTY
}
echo ""
echo "Press any key to start..."
char=`get_char`
create_db="create database IF NOT EXISTS ${DBNAME}"
mysql -u${USERNAME} -p${PASSWORD} -e "${create_db}" #创建名为wordpress的数据库,如果不存在http://www.dabu.info/?p=4329
wget -c http:#cn.wordpress.org/wordpress-3.7.1-zh_CN.zip #下载wordpress网站程序
unzip wordpress-3.7.1-zh_CN.zip #解压wordpress程序
cd wordpress #切换到解压后的wordpress目录
cp ./* ${WEBROOT} #将网站程序复制到网站根目录
\cp ${OLD_WP-CONFIG} ${WEBROOT} #将原先的wordpress的配置文件wp-config.php放到网站根目录
mysql -u${USERNAME} -p${PASSWORD} ${DBNAME} <${BACKUPSQL} #导入你备份的数据库到wordpress数据库里
echo "###################################################################\n"
echo "please view you blog to check the success or failure.\n"
echo "view my blog:http://www.dabu.info/ if you have question!!\n"
echo "###################################################################\n"
wget -c http:#cn.wordpress.org/wordpress-3.7.1-zh_CN.zip #下载wordpress网站程序
unzip wordpress-3.7.1-zh_CN.zip #解压wordpress程序
cd wordpress #切换到解压后的wordpress目录
cp ./* /home/wwwroot/ #将网站程序复制到网站根目录
\cp ${OLD_WP-CONFIG} ${WEBROOT}
wget -c http:#cn.wordpress.org/wordpress-3.7.1-zh_CN.zip #下载wordpress网站程序
unzip wordpress-3.7.1-zh_CN.zip #解压wordpress程序
cd wordpress #切换到解压后的wordpress目录
cp ./* /home/wwwroot/ #将网站程序复制到网站根目录
\cp ${OLD_WP-CONFIG} ${WEBROOT}
tar -zvxf all.tar.gz /home
drop database
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有