upgrade php.sh在哪里,upgrade.sh

这篇文章介绍了一个名为OneinStack的脚本,用于在CentOS/RadHat 5、Debian 6和Ubuntu 12+上一键升级Web服务器(Nginx/Tengine/OpenResty)、数据库(MySQL/MariaDB/Percona)、PHP、Redis和phpMyAdmin。只需提供权限并选择要升级的服务,即可完成自动化更新。
摘要由CSDN通过智能技术生成

#!/bin/bash

# Author: yeho

# BLOG: https://blog.linuxeye.com

#

# Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+

#

# Project home page:

# https://oneinstack.com

# https://github.com/lj2007331/oneinstack

export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

clear

printf "

#######################################################################

# OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+ #

# upgrade Web,Database,PHP,Redis,phpMyAdmin for OneinStack #

# For more information please visit https://oneinstack.com #

#######################################################################

"

# get pwd

sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf

. ./versions.txt

. ./options.conf

. ./include/color.sh

. ./include/check_os.sh

. ./include/check_dir.sh

. ./include/download.sh

. ./include/get_char.sh

. ./include/upgrade_web.sh

. ./include/upgrade_db.sh

. ./include/upgrade_php.sh

. ./include/upgrade_redis.sh

. ./include/upgrade_phpmyadmin.sh

# Check if user is root

[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }

# get the IP information

PUBLIC_IPADDR=`./include/get_public_ipaddr.py`

[ "`./include/get_ipaddr_state.py $PUBLIC_IPADDR`" == '\u4e2d\u56fd' ] && IPADDR_STATE=CN

Usage(){

printf "

Usage: $0 [ ${CMSG}web${CEND} | ${CMSG}db${CEND} | ${CMSG}php${CEND} | ${CMSG}redis${CEND} | ${CMSG}phpmyadmin${CEND} ]

${CMSG}web${CEND} --->Upgrade Nginx/Tengine/OpenResty

${CMSG}db${CEND} --->Upgrade MySQL/MariaDB/Percona

${CMSG}php${CEND} --->Upgrade PHP

${CMSG}redis${CEND} --->Upgrade Redis

${CMSG}phpmyadmin${CEND} --->Upgrade phpMyAdmin

"

}

Menu(){

while :; do

printf "

What Are You Doing?

\t${CMSG}1${CEND}. Upgrade Nginx/Tengine/OpenResty

\t${CMSG}2${CEND}. Upgrade MySQL/MariaDB/Percona

\t${CMSG}3${CEND}. Upgrade PHP

\t${CMSG}4${CEND}. Upgrade Redis

\t${CMSG}5${CEND}. Upgrade phpMyAdmin

\t${CMSG}q${CEND}. Exit

"

echo

read -p "Please input the correct option: " Number

if [[ ! $Number =~ ^[1-5,q]$ ]];then

echo "${CWARNING}input error! Please only input 1,2,3,4,5 and q${CEND}"

else

case "$Number" in

1)

if [ -e "$nginx_install_dir/sbin/nginx" ];then

Upgrade_Nginx

elif [ -e "$tengine_install_dir/sbin/nginx" ];then

Upgrade_Tengine

elif [ -e "$openresty_install_dir/nginx/sbin/nginx" ];then

Upgrade_OpenResty

fi

;;

2)

Upgrade_DB

;;

3)

Upgrade_PHP

;;

4)

Upgrade_Redis

;;

5)

Upgrade_phpMyAdmin

;;

q)

exit

;;

esac

fi

done

}

if [ $# == 0 ];then

Menu

elif [ $# == 1 ];then

case $1 in

web)

if [ -e "$nginx_install_dir/sbin/nginx" ];then

Upgrade_Nginx

elif [ -e "$tengine_install_dir/sbin/nginx" ];then

Upgrade_Tengine

elif [ -e "$openresty_install_dir/nginx/sbin/nginx" ];then

Upgrade_OpenResty

fi

;;

db)

Upgrade_DB

;;

php)

Upgrade_PHP

;;

redis)

Upgrade_Redis

;;

phpmyadmin)

Upgrade_phpMyAdmin

;;

*)

Usage

;;

esac

else

Usage

fi

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值