diff --git a/README.md b/README.md index 4a087e5..51c012c 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -### 自用 \ No newline at end of file +### 自用-半成品 \ No newline at end of file diff --git a/aapanel.sh b/aapanel.sh new file mode 100644 index 0000000..e6af5ff --- /dev/null +++ b/aapanel.sh @@ -0,0 +1,66 @@ +#! /bin/bash +# By Aaron +# https://github.com/AaronYES/aapanel + +#彩色 +red(){ + echo -e "\033[31m\033[01m$1\033[0m" +} +green(){ + echo -e "\033[32m\033[01m$1\033[0m" +} +yellow(){ + echo -e "\033[33m\033[01m$1\033[0m" +} +blue(){ + echo -e "\033[34m\033[01m$1\033[0m" +} +purple(){ + echo -e "\033[35m\033[01m$1\033[0m" +} + +# 下载aapanel面板 +function aapanel-install(){ +wget -O "/root/aapanel-install.sh" http://www.aapanel.com/script/install_6.0_en.sh +blue "下载完成,正在安装官网原版." +bash "/root/aapanel-install.sh" +} + +# 降级aapanel(最后一个无广告版本) +function downgrade-official(){ +wget -O "/root/LinuxPanel_EN-6.8.23.zip" http://node.aapanel.com/install/update/LinuxPanel_EN-6.8.23.zip +blue "下载完成,正在降级." +unzip LinuxPanel_EN-6.8.23.zip +cd /root/panel + +} + +# 菜单 +function start_menu(){ + clear + blue "aaPanel 面板工具箱" + purple "练手脚本 方便自己使用" + yellow " ==================================================" + green " 1. CentOS/Debian/Ubuntu 安装 aaPanel" + yellow " --------------------------------------------------" + green " 2. 降级 6.8.23 版本 aaPanel(官网)" + green " 3. 降级 6.8.23 版本 aaPanel(GitHub仓库)" + yellow " --------------------------------------------------" + green " 0. 退出脚本" + echo + read -p "请输入数字:" menuNumberInput + case "$menuNumberInput" in + 1 ) + aapanel-install + ;; + 0 ) + exit 1 + ;; + * ) + clear + red "请输入正确数字 !" + start_menu + ;; + esac +} +start_menu "first" \ No newline at end of file diff --git a/downgrade.sh b/downgrade.sh new file mode 100644 index 0000000..f7b1e01 --- /dev/null +++ b/downgrade.sh @@ -0,0 +1,30 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +export PATH +LANG=en_US.UTF-8 + +# aapanel离线升级脚本 + +panel_path='/www/server/panel' + +if [ ! -d $panel_path ];then +echo "当前未安装aapanel面板!" +exit 0; +fi + +base_dir=$(cd "$(dirname "$0")";pwd) +if [ $base_dir = $panel_path ];then +echo "不能在面板根目录执行降级命令!" +exit 0; +fi + +if [ ! -d $base_dir/class ];then +echo "没有找到降级文件!" +exit 0; +fi + +rm -f $panel_path/*.pyc $panel_path/class/*.pyc +\cp -r -f $base_dir/. $panel_path/ +/etc/init.d/bt restart +echo "====================================" +echo "已完成降级!" \ No newline at end of file