Remove interactive features for remote-only execution

- Remove interactive menu (requires stdin)
- Remove --connect option (requires stdin)
- Remove --save option (not practical for remote execution)
- Show help when run without arguments
- Update help to show curl usage example
- Update README for remote-only usage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-24 17:22:37 -05:00
parent 575c60b1fa
commit d9e546f75d
2 changed files with 24 additions and 79 deletions

View File

@@ -438,7 +438,9 @@ list_containers() {
###################
help() {
echo "ProxDoc - The Proxmox System Doctor v${VERSION}"
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Usage: curl -sL \"http://10.10.10.63:3000/LotusGuild/proxDoc/raw/branch/main/proxDoc.sh\" | bash -s -- [OPTION]"
echo ""
echo "A comprehensive diagnostic tool for Proxmox server health checks."
echo ""
echo "Treatment Options:"
@@ -453,61 +455,11 @@ help() {
echo " --vm-list Check VM vitals"
echo " --ct-list Check container vitals"
echo " --backup Review backup health"
echo " --connect Make a house call to a remote Proxmox host"
echo " --save Save examination results to medical record"
echo ""
echo "Interactive mode: Run without arguments for menu"
exit 0
}
connectToHost() {
read -rp "Enter the address for house call (hostname/IP): " remote_host
echo -e "${YELLOW}Preparing for remote consultation with $remote_host...${NC}"
if ping -c 1 "$remote_host" >/dev/null 2>&1; then
ssh "root@$remote_host"
else
handle_error "Patient $remote_host is not responding"
fi
}
show_menu() {
echo ""
echo -e "${GREEN}Select a diagnostic option:${NC}"
echo ""
echo " 1) Full System Diagnostics"
echo " 2) Quick Health Check"
echo " 3) Drive Atlas (Physical Bay Mapping)"
echo " 4) Check Proxmox Services"
echo " 5) VM Status"
echo " 6) Container Status"
echo " 7) Ceph Cluster Health"
echo " 8) Node Exporter Status"
echo " 9) hwmon Daemon Status"
echo " 10) Backup Status"
echo " 11) Connect to Remote Host"
echo " 12) Save Full Report to File"
echo " 0) Exit"
echo ""
read -rp "Enter choice [0-12]: " choice
case $choice in
1) check_requirements; runDiags ;;
2) quick_health_check ;;
3) get_drive_atlas ;;
4) check_services ;;
5) list_vms ;;
6) list_containers ;;
7) get_ceph_health ;;
8) get_node_exporter_status ;;
9) get_hwmon_status ;;
10) echo -e "${GREEN}Backup Status:${NC}"; pvesm status 2>/dev/null || log_message warn "pvesm not available" ;;
11) connectToHost ;;
12) exec 1> >(tee "proxmox_diag_$(date '+%Y%m%d_%H%M%S').log"); runDiags ;;
0) echo "Goodbye!"; exit 0 ;;
*) echo -e "${RED}Invalid option${NC}"; show_menu ;;
esac
}
###################
# Main Functions
@@ -549,12 +501,10 @@ checkForInput() {
--ceph) get_ceph_health ;;
--node-exporter) get_node_exporter_status ;;
--hwmon) get_hwmon_status ;;
--connect) connectToHost ;;
--services) check_services ;;
--vm-list) list_vms ;;
--ct-list) list_containers ;;
--backup) echo -e "${GREEN}Backup Status:${NC}"; pvesm status 2>/dev/null || log_message warn "pvesm not available" ;;
--save) exec 1> >(tee "proxmox_diag_$(date '+%Y%m%d_%H%M%S').log"); check_requirements; runDiags ;;
*) echo -e "${RED}Invalid option: $1${NC}"; help ;;
esac
}
@@ -579,5 +529,5 @@ trap 'echo -e "${RED}Script interrupted.${NC}"; exit 1' INT TERM
if [[ -n $argOne ]]; then
checkForInput "$argOne"
else
show_menu
help
fi