Improvement LEMPer CLI plugins

This commit is contained in:
Edi Septriyanto
2024-08-02 22:23:21 +07:00
parent 74e2aa41bb
commit f1203ce7d4
3 changed files with 27 additions and 10 deletions

View File

@@ -162,9 +162,12 @@ Usage: ${PROG_NAME} [--version] [--help]
<command> [<options>]
These are common ${PROG_NAME} commands used in various situations:
create Create new virtual host (add new domain to LEMPer stack).
db Wrapper for managing SQL database (MySQL and MariaDB).
manage Manage existing virtual host (enable, disable, delete, etc).
create Create new virtual host (add new domain to LEMPer stack).
add An aliases of 'create' sub command.
database Wrapper for managing SQL database (MySQL and MariaDB).
db An aliases of 'databases' sub command.
manage Manage existing virtual host (enable, disable, delete, etc).
mod An aliases of 'manage' sub command.
For help with each command run:
${PROG_NAME} <command> -h | --help

View File

@@ -78,6 +78,7 @@ These are common ${CMD_PARENT} ${CMD_NAME} subcommands used in various situation
drop Deletes the database.
export Exports a database to a file or to STDOUT.
import Imports a database from a file or from STDIN.
list An aliases of databases sub command.
optimize Optimizes the database.
query Executes a SQL query against the database.
repair Repairs the database.
@@ -209,6 +210,10 @@ function cmd_show() {
cmd_databases "$@"
}
function cmd_list() {
cmd_databases "$@"
}
function cmd_size() {
echo "Displays the database name and size."
db_ops "--action=size" "$@"
@@ -612,7 +617,7 @@ function db_ops() {
done
fi
# Ensure mariadb / "${MYSQLCLI}" command is available before performing database operations.
# Ensure mariadb / mysql command is available before performing database operations.
if [[ -n $(command -v mariadb) ]]; then
MYSQLCLI=$(command -v mariadb)
elif [[ -n $(command -v mysql) ]]; then

View File

@@ -41,15 +41,24 @@ function init_tools_install() {
run cp -f lib/lemper-site.sh /etc/lemper/cli-plugins/lemper-site && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-site
run cp -f lib/lemper-create.sh /etc/lemper/cli-plugins/lemper-site-add && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-site-add
run cp -f lib/lemper-create.sh /etc/lemper/cli-plugins/lemper-site-create && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-site-create
run cp -f lib/lemper-manage.sh /etc/lemper/cli-plugins/lemper-site-mod && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-site-mod
[ -f /etc/lemper/cli-plugins/lemper-site-create ] && \
run ln -fs /etc/lemper/cli-plugins/lemper-site-create /etc/lemper/cli-plugins/lemper-site-add
run cp -f lib/lemper-manage.sh /etc/lemper/cli-plugins/lemper-site-manage && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-site-manage
[ -f /etc/lemper/cli-plugins/lemper-site-manage ] && \
run ln -fs /etc/lemper/cli-plugins/lemper-site-manage /etc/lemper/cli-plugins/lemper-site-mod
run cp -f lib/lemper-db.sh /etc/lemper/cli-plugins/lemper-db && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-db
[ -f /etc/lemper/cli-plugins/lemper-site-db ] && \
run ln -fs /etc/lemper/cli-plugins/lemper-site-db /etc/lemper/cli-plugins/lemper-site-database
run cp -f lib/lemper-selfssl.sh /etc/lemper/cli-plugins/lemper-selfssl && \
run chmod ugo+x /etc/lemper/cli-plugins/lemper-selfssl
@@ -113,7 +122,6 @@ function init_tools_install() {
local CURRENT_DIR && \
CURRENT_DIR=$(pwd)
run cd /usr/share/nginx/html/lcp/filemanager && \
#run git pull
run wget -q https://raw.githubusercontent.com/joglomedia/tinyfilemanager/lemperfm_1.3.0/index.php \
-O /usr/share/nginx/html/lcp/filemanager/index.php && \
run cd "${CURRENT_DIR}" || return 1
@@ -147,7 +155,7 @@ function init_tools_install() {
CURRENT_DIR=$(pwd)
run cd /usr/share/nginx/html/lcp/memcadmin && \
run git config --global --add safe.directory /usr/share/nginx/html/lcp/memcadmin && \
run git pull && \
run git pull -q && \
run cd "${CURRENT_DIR}" || return 1
fi
@@ -221,6 +229,7 @@ EOL
fi
else
run cd redisadmin && \
run mv composer.lock composer.lock~
run "${COMPOSER_BIN}" -q update
fi