diff --git a/lcmp/conf/index.html b/lcmp/conf/index.html
deleted file mode 100644
index ca8ef32..0000000
--- a/lcmp/conf/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
恭喜!LCMP 环境安装成功!
-
LCMP (Linux + Caddy + MariaDB + PHP) 是一个强大的 Bash 脚本,用于一键安装 Caddy2 + MariaDB + PHP 等。
-
-
-
-
diff --git a/lcmp/conf/lcmp b/lcmp/conf/lcmp
deleted file mode 100644
index e16a48f..0000000
--- a/lcmp/conf/lcmp
+++ /dev/null
@@ -1,383 +0,0 @@
-#!/bin/bash
-
-trap _exit INT QUIT TERM
-
-_red() {
- printf '\033[1;31;31m%b\033[0m' "$1"
-}
-
-_green() {
- printf '\033[1;31;32m%b\033[0m' "$1"
-}
-
-_yellow() {
- printf '\033[1;31;33m%b\033[0m' "$1"
-}
-
-_printargs() {
- printf -- "%s" "[$(date)] "
- printf -- "%s" "$1"
- printf "\n"
-}
-
-_info() {
- _printargs "$@"
-}
-
-_warn() {
- printf -- "%s" "[$(date)] "
- _yellow "$1"
- printf "\n"
-}
-
-_error() {
- printf -- "%s" "[$(date)] "
- _red "$1"
- printf "\n"
- exit 2
-}
-
-_exit() {
- printf "\n"
- _red "$0 已终止。"
- printf "\n"
- exit 1
-}
-
-_exists() {
- local cmd="$1"
- if eval type type >/dev/null 2>&1; then
- eval type "$cmd" >/dev/null 2>&1
- elif command >/dev/null 2>&1; then
- command -v "$cmd" >/dev/null 2>&1
- else
- which "$cmd" >/dev/null 2>&1
- fi
- local rt=$?
- return ${rt}
-}
-
-_error_detect() {
- local cmd="$1"
- _info "${cmd}"
- if ! eval "${cmd}" 1>/dev/null; then
- _error "执行命令 (${cmd}) 失败,请检查并重试。"
- fi
-}
-
-_sleep_sec() {
- seconds=$1
- while [ "${seconds}" -ge "0" ]; do
- echo -ne "\r \r"
- _green "${seconds}"
- seconds=$((seconds - 1))
- sleep 1
- done
- echo -ne "\r"
-}
-
-check_sys() {
- local value="$1"
- local release=''
- if [ -f /etc/redhat-release ]; then
- release="rhel"
- elif grep -Eqi "debian" /etc/issue; then
- release="debian"
- elif grep -Eqi "ubuntu" /etc/issue; then
- release="ubuntu"
- elif grep -Eqi "centos|red hat|redhat" /etc/issue; then
- release="rhel"
- elif grep -Eqi "debian" /proc/version; then
- release="debian"
- elif grep -Eqi "ubuntu" /proc/version; then
- release="ubuntu"
- elif grep -Eqi "centos|red hat|redhat" /proc/version; then
- release="rhel"
- fi
- if [ "${value}" == "${release}" ]; then
- return 0
- else
- return 1
- fi
-}
-
-vhost() {
- case "$1" in
- [aA][dD][dD])
- add_vhost
- ;;
- [lL][iI][sS][tT])
- list_vhost
- ;;
- [dD][eE][lL])
- del_vhost
- ;;
- *)
- _error "用法: lcmp vhost [add|list|del]"
- ;;
- esac
-}
-
-database() {
- case "$1" in
- [aA][dD][dD])
- add_database_menu
- add_database
- ;;
- [lL][iI][sS][tT])
- list_database
- ;;
- [dD][eE][lL])
- del_database
- ;;
- [eE][dD][iI][tT])
- edit_database
- ;;
- *)
- _error "用法: lcmp db [add|list|del|edit]"
- ;;
- esac
-}
-
-add_vhost() {
- while true; do
- read -r -p "[$(date)] 请输入域名(例如: www.example.com): " domain
- if [ -n "${domain}" ] && [[ "${domain}" = "${domain%[[:space:]]*}" ]]; then
- if [ -f "/etc/caddy/conf.d/${domain}.conf" ]; then
- _error "域名 ${domain} 已存在,请检查并重试。"
- else
- _info "域名: $(_green "${domain}")"
- fi
- break
- else
- _red "域名不能为空或包含空格。\n"
- fi
- done
-
- read -r -p "[$(date)] 请输入域名 ${domain} 的目录(默认目录: /data/www/${domain}): " vhostdir
- if [ -z "${vhostdir}" ]; then
- vhostdir="/data/www/${domain}"
- fi
- _info "虚拟主机目录: $(_green "${vhostdir}")"
-
- read -r -p "[$(date)] 是否创建一个 MariaDB 数据库及相同名称的用户 (y/n): " create_database
- if [ "${create_database}" == "y" ] || [ "${create_database}" == "Y" ]; then
- verify_db_password
- add_database_menu
- fi
- _info "创建虚拟主机目录"
- _error_detect "mkdir -p ${vhostdir}"
- _info "设置虚拟主机目录权限"
- _error_detect "chmod -R 755 ${vhostdir}"
- _error_detect "chown -R caddy:caddy ${vhostdir}"
- add_vhost_config
- if [ "${create_database}" == "y" ] || [ "${create_database}" == "Y" ]; then
- add_database
- fi
- _error_detect "systemctl restart caddy"
- _info "虚拟主机信息:"
- _info "域名: $(_green "${domain}")"
- _info "虚拟主机目录: $(_green "${vhostdir}")"
- _info "虚拟主机配置: $(_green "/etc/caddy/conf.d/${domain}.conf")"
- list_vhost
- if [ "${create_database}" == "y" ] || [ "${create_database}" == "Y" ]; then
- _info "数据库用户名: ${database_name}"
- _info "数据库用户密码: ${mysql_password}"
- _info "数据库名称: ${database_name}"
- fi
-}
-
-add_vhost_config() {
- cat >"/etc/caddy/conf.d/${domain}.conf" <