refactor: extract interactive menus into dedicated index scripts
- move apps menu from inline lxs.sh function to apps/index.sh - add tools/index.sh as entry point for tools menu - rename system-tools.sh to system-infos.sh - simplify help text to point users to the interactive menu - update README directory tree to reflect new structure
This commit is contained in:
@@ -252,7 +252,7 @@ cmd_help() {
|
||||
LXS - Linux multi-tool (v${LXS_VERSION})
|
||||
|
||||
Usage:
|
||||
lxs Interactive menu
|
||||
lxs Interactive menu (browse apps and tools)
|
||||
lxs setup Install lxs and all sub-scripts to ${LXS_INSTALL_DIR}
|
||||
lxs update Update all installed files to latest
|
||||
lxs install <app> Install an application
|
||||
@@ -261,17 +261,7 @@ Usage:
|
||||
lxs version Show version
|
||||
lxs help Show this help
|
||||
|
||||
Applications (lxs install ...):
|
||||
coolify Self-hosted PaaS
|
||||
pterodactyl Game server management panel
|
||||
uptime-kuma Monitoring tool
|
||||
cloudpanel Web hosting control panel
|
||||
proxmox Proxmox VE management tools
|
||||
|
||||
Tools (lxs tool ...):
|
||||
system System monitoring and diagnostics
|
||||
benchmark Server benchmark (CPU/RAM/disk/network)
|
||||
harden Baseline hardening (UFW + fail2ban + SSH key-only + auto-updates)
|
||||
Run \`lxs\` for the interactive menu to browse available applications and tools.
|
||||
|
||||
Source: ${LXS_REPO_URL}
|
||||
EOF
|
||||
@@ -294,7 +284,7 @@ cmd_tool() {
|
||||
local tool="${1:-}"
|
||||
shift || true
|
||||
case "$tool" in
|
||||
system) download_and_run "tools/system-tools.sh" "$@" ;;
|
||||
system) download_and_run "tools/system-infos.sh" "$@" ;;
|
||||
benchmark) download_and_run "tools/server-benchmark.sh" "$@" ;;
|
||||
harden) download_and_run "tools/harden.sh" "$@" ;;
|
||||
"") echo -e "${RED}[✗] Missing tool name. Try: lxs help${NC}"; return 1 ;;
|
||||
@@ -381,41 +371,9 @@ cmd_install_self() {
|
||||
}
|
||||
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
# Interactive menus
|
||||
# Interactive menu
|
||||
# ═══════════════════════════════════════════════════════════════════════════
|
||||
|
||||
menu_install_apps() {
|
||||
while true; do
|
||||
show_header
|
||||
echo -e "${WHITE}${BOLD}APPLICATIONS${NC}"
|
||||
echo ""
|
||||
echo -e " ${GREEN}[1]${NC} Coolify"
|
||||
echo -e " ${GREEN}[2]${NC} Pterodactyl Panel"
|
||||
echo -e " ${GREEN}[3]${NC} Uptime Kuma"
|
||||
echo -e " ${GREEN}[4]${NC} CloudPanel"
|
||||
echo -e " ${GREEN}[5]${NC} Proxmox VE Tools"
|
||||
echo -e " ${RED}[0]${NC} Back"
|
||||
echo ""
|
||||
echo -e -n "${BOLD}Choice [0-5]: ${NC}"
|
||||
read -r choice
|
||||
|
||||
case $choice in
|
||||
1) download_and_run "apps/coolify.sh" ;;
|
||||
2) download_and_run "apps/pterodactyl.sh" ;;
|
||||
3) download_and_run "apps/uptime-kuma.sh" ;;
|
||||
4) download_and_run "apps/cloudpanel.sh" ;;
|
||||
5) download_and_run "apps/proxmox.sh" ;;
|
||||
0) return ;;
|
||||
*) echo -e "${RED}[✗] Invalid option. Please select 0-5.${NC}"; sleep 1 ;;
|
||||
esac
|
||||
|
||||
if [ "$choice" != "0" ]; then
|
||||
echo ""
|
||||
read -r -p "Press Enter to continue..."
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
main_menu() {
|
||||
check_os
|
||||
check_remote_version
|
||||
@@ -424,7 +382,7 @@ main_menu() {
|
||||
echo -e "${WHITE}${BOLD}MAIN MENU${NC}"
|
||||
echo ""
|
||||
echo -e " ${GREEN}[1]${NC} Applications"
|
||||
echo -e " ${CYAN}[2]${NC} System Tools"
|
||||
echo -e " ${CYAN}[2]${NC} Tools"
|
||||
echo -e " ${GRAY}[u]${NC} Update lxs"
|
||||
echo -e " ${RED}[0]${NC} Exit"
|
||||
echo ""
|
||||
@@ -432,8 +390,8 @@ main_menu() {
|
||||
read -r choice
|
||||
|
||||
case $choice in
|
||||
1) menu_install_apps ;;
|
||||
2) download_and_run "tools/system-tools.sh" ;;
|
||||
1) download_and_run "apps/index.sh" ;;
|
||||
2) download_and_run "tools/index.sh" ;;
|
||||
u|U) cmd_update ;;
|
||||
0)
|
||||
clear
|
||||
@@ -444,7 +402,7 @@ main_menu() {
|
||||
*) echo -e "${RED}[✗] Invalid option.${NC}"; sleep 1 ;;
|
||||
esac
|
||||
|
||||
if [[ "$choice" != "0" && "$choice" != "1" ]]; then
|
||||
if [[ "$choice" != "0" && "$choice" != "1" && "$choice" != "2" ]]; then
|
||||
echo ""
|
||||
read -r -p "Press Enter to continue..."
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user