代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
# Copyright (C) 2013 - 2021 Teddysun <i@teddysun.com>
#
# This file is part of the LAMP script.
#
# LAMP is a powerful bash script for the installation of
# Apache + PHP + MySQL/MariaDB and so on.
# You can install Apache + PHP + MySQL/MariaDB in an very easy way.
# Just need to input numbers to choose what you want to install before installation.
# And all things will be done in a few minutes.
#
# Website: https://lamp.sh
# Github: https://github.com/teddysun/lamp
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
cur_dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
include(){
local include=$1
if [[ -s ${cur_dir}/include/${include}.sh ]];then
. ${cur_dir}/include/${include}.sh
else
echo "Error:${cur_dir}/include/${include}.sh not found, shell can not be executed."
exit 1
fi
}
upgrade_menu(){
echo
echo "+-------------------------------------------------------------------+"
echo "| Auto Update LAMP(Linux + Apache + MySQL/MariaDB + PHP ) |"
echo "| Website: https://lamp.sh |"
echo "| Author : Teddysun <i@teddysun.com> |"
echo "+-------------------------------------------------------------------+"
echo
while true
do
_info "$(_green 1). Upgrade Apache"
_info "$(_green 2). Upgrade MySQL or MariaDB"
_info "$(_green 3). Upgrade PHP"
_info "$(_green 4). Upgrade phpMyAdmin"
_info "$(_green 5). Upgrade Adminer"
_info "$(_green 6). Exit"
echo
read -p "Please input a number: " number
if [[ ! ${number} =~ ^[1-6]$ ]]; then
_error "Input error, please only input 1~6"
else
case "${number}" in
1)
upgrade_apache 2>&1 | tee ${cur_dir}/upgrade_apache.log
break
;;
2)
upgrade_db 2>&1 | tee ${cur_dir}/upgrade_db.log
break
;;
3)
upgrade_php 2>&1 | tee ${cur_dir}/upgrade_php.log
break
;;
4)
upgrade_phpmyadmin 2>&1 | tee ${cur_dir}/upgrade_phpmyadmin.log
break
;;
5)
upgrade_adminer 2>&1 | tee ${cur_dir}/upgrade_adminer.log
break
;;
6)
exit
;;
esac
fi
done
}
display_usage(){
printf "
Usage: $0 [ apache | db | php | phpmyadmin | adminer ]
apache --->Upgrade Apache
db --->Upgrade MySQL or MariaDB
php --->Upgrade PHP
phpmyadmin --->Upgrade phpMyAdmin
adminer --->Upgrade Adminer
"
}
include config
include public
include php-modules
include upgrade_apache
include upgrade_db
include upgrade_php
include upgrade_phpmyadmin
include upgrade_adminer
load_config
rootness
if [ ${#} -eq 0 ]; then
upgrade_menu
elif [ ${#} -eq 1 ]; then
case $1 in
apache)
upgrade_apache 2>&1 | tee ${cur_dir}/upgrade_apache.log
;;
db)
upgrade_db 2>&1 | tee ${cur_dir}/upgrade_db.log
;;
php)
upgrade_php 2>&1 | tee ${cur_dir}/upgrade_php.log
;;
phpmyadmin)
upgrade_phpmyadmin 2>&1 | tee ${cur_dir}/upgrade_phpmyadmin.log
;;
adminer)
upgrade_adminer 2>&1 | tee ${cur_dir}/upgrade_adminer.log
;;
*)
display_usage
;;
esac
else
display_usage
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。