update footer

This commit is contained in:
MacRimi 2025-04-16 21:49:03 +02:00
parent 2d04f38134
commit 6c45535875
4 changed files with 469 additions and 283 deletions

View File

@ -47,85 +47,155 @@ fi
# 01 Useful System Commands # 01 Useful System Commands
# =============================================================== # ===============================================================
show_system_commands() { show_system_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Useful System Commands')${NC}" clear
echo "----------------------------------------" echo -e "${YELLOW}$(translate 'Useful System Commands')${NC}"
echo -e " 1) ${GREEN}pveversion${NC} - $(translate 'Show Proxmox version')" echo "----------------------------------------"
echo -e " 2) ${GREEN}pveversion -v${NC} - $(translate 'Detailed Proxmox version info')" echo -e " 1) ${GREEN}pveversion${NC} - $(translate 'Show Proxmox version')"
echo -e " 3) ${GREEN}systemctl status pveproxy${NC} - $(translate 'Check Proxmox Web UI status')" echo -e " 2) ${GREEN}pveversion -v${NC} - $(translate 'Detailed Proxmox version info')"
echo -e " 4) ${GREEN}systemctl restart pveproxy${NC} - $(translate 'Restart Web UI proxy')" echo -e " 3) ${GREEN}systemctl status pveproxy${NC} - $(translate 'Check Proxmox Web UI status')"
echo -e " 5) ${GREEN}journalctl -xe${NC} - $(translate 'System errors and logs')" echo -e " 4) ${GREEN}systemctl restart pveproxy${NC} - $(translate 'Restart Web UI proxy')"
echo -e " 6) ${GREEN}uptime${NC} - $(translate 'System uptime')" echo -e " 5) ${GREEN}journalctl -xe${NC} - $(translate 'System errors and logs')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 6) ${GREEN}uptime${NC} - $(translate 'System uptime')"
echo echo -e " 7) ${GREEN}hostnamectl${NC} - $(translate 'System hostname and kernel info')"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo -e " 8) ${GREEN}free -h${NC} - $(translate 'RAM and swap usage')"
read -r user_input echo -e " 9) ${GREEN}uptime -p${NC} - $(translate 'Pretty uptime format')"
echo -e "10) ${GREEN}who -b${NC} - $(translate 'Last system boot time')"
echo -e "11) ${GREEN}last -x | grep shutdown${NC} - $(translate 'Previous shutdowns')"
echo -e "12) ${GREEN}dmesg -T | tail -n 50${NC} - $(translate 'Last 50 kernel log lines')"
echo -e "13) ${GREEN}cat /etc/os-release${NC} - $(translate 'OS release details')"
echo -e "14) ${GREEN}uname -a${NC} - $(translate 'Kernel and architecture info')"
echo -e "15) ${GREEN}uptime && w${NC} - $(translate 'Uptime and who is logged in')"
echo -e "16) ${GREEN}whoami${NC} - $(translate 'Current user')"
echo -e "17) ${GREEN}id${NC} - $(translate 'Current user UID, GID and groups')"
echo -e "18) ${GREEN}who${NC} - $(translate 'Logged-in users')"
echo -e "19) ${GREEN}w${NC} - $(translate 'User activity and uptime')"
echo -e "20) ${GREEN}cut -d: -f1,3,4 /etc/passwd${NC} - $(translate 'All users with UID and GID')"
echo -e "21) ${GREEN}getent passwd | column -t -s :${NC} - $(translate 'Readable user table (UID, shell, etc.)')"
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="pveversion" ;; 1) cmd="pveversion" ;;
2) cmd="pveversion -v" ;; 2) cmd="pveversion -v" ;;
3) cmd="systemctl status pveproxy" ;; 3) cmd="systemctl status pveproxy" ;;
4) cmd="systemctl restart pveproxy" ;; 4) cmd="systemctl restart pveproxy" ;;
5) cmd="journalctl -xe" ;; 5) cmd="journalctl -xe" ;;
6) cmd="uptime" ;; 6) cmd="uptime" ;;
7) cmd="htop" ;; 7) cmd="hostnamectl" ;;
0) return ;; 8) cmd="free -h" ;;
*) cmd="$user_input" ;; 9) cmd="uptime -p" ;;
esac 10) cmd="who -b" ;;
11) cmd="last -x | grep shutdown" ;;
12) cmd="dmesg -T | tail -n 50" ;;
13) cmd="cat /etc/os-release" ;;
14) cmd="uname -a" ;;
15) cmd="uptime && w" ;;
16) cmd="whoami" ;;
17) cmd="id" ;;
18) cmd="who" ;;
19) cmd="w" ;;
20) cmd="cut -d: -f1,3,4 /etc/passwd" ;;
21) cmd="getent passwd | column -t -s :" ;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
# =============================================================== # ===============================================================
# 02 VM and CT Management Commands # 02 VM and CT Management Commands
# =============================================================== # ===============================================================
show_vm_ct_commands() { show_vm_ct_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'VM and CT Management Commands')${NC}" clear
echo "---------------------------------------------------" echo -e "${YELLOW}$(translate 'VM and CT Management Commands')${NC}"
echo -e " 1) ${GREEN}qm list${NC} - $(translate 'List all virtual machines')" echo "---------------------------------------------------"
echo -e " 2) ${GREEN}pct list${NC} - $(translate 'List all LXC containers')" echo -e " 1) ${GREEN}qm list${NC} - $(translate 'List all virtual machines')"
echo -e " 3) ${GREEN}qm start <vmid>${NC} - $(translate 'Start a virtual machine. Replace <vmid> with the correct ID')" echo -e " 2) ${GREEN}pct list${NC} - $(translate 'List all LXC containers')"
echo -e " 4) ${GREEN}pct start <ctid>${NC} - $(translate 'Start a container. Replace <ctid> with the correct ID')" echo -e " 3) ${GREEN}qm start <vmid>${NC} - $(translate 'Start a virtual machine. Use the correct <vmid>')"
echo -e " 5) ${GREEN}qm stop <vmid>${NC} - $(translate 'Force stop a virtual machine. Replace <vmid> with the correct ID')" echo -e " 4) ${GREEN}pct start <ctid>${NC} - $(translate 'Start a container. Use the correct <ctid>')"
echo -e " 6) ${GREEN}pct stop <ctid>${NC} - $(translate 'Force stop a container. Replace <ctid> with the correct ID')" echo -e " 5) ${GREEN}qm stop <vmid>${NC} - $(translate 'Force stop a virtual machine. Use the correct <vmid>')"
echo -e " 7) ${GREEN}qm config <vmid>${NC} - $(translate 'Show VM configuration. Replace <vmid> with the correct ID')" echo -e " 6) ${GREEN}pct stop <ctid>${NC} - $(translate 'Force stop a container. Use the correct <ctid>')"
echo -e " 8) ${GREEN}pct config <ctid>${NC} - $(translate 'Show container configuration. Replace <ctid> with the correct ID')" echo -e " 7) ${GREEN}qm config <vmid>${NC} - $(translate 'Show VM configuration. Use the correct <vmid>')"
echo -e " 9) ${GREEN}qm destroy <vmid>${NC} - $(translate 'Delete a VM (irreversible). Replace <vmid> with the correct ID')" echo -e " 8) ${GREEN}pct config <ctid>${NC} - $(translate 'Show container configuration. Use the correct <ctid>')"
echo -e " 10) ${GREEN}pct destroy <ctid>${NC} - $(translate 'Delete a CT (irreversible). Replace <vmid> with the correct ID')" echo -e " 9) ${GREEN}qm destroy <vmid>${NC} - $(translate 'Delete a VM (irreversible). Use the correct <vmid>')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e "10) ${GREEN}pct destroy <ctid>${NC} - $(translate 'Delete a CT (irreversible). Use the correct <ctid>')"
echo echo -e "11) ${GN}[Only with menu] Show CT users for permission mapping${NC} - $(translate 'root and real users only')"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo -e "12) ${GREEN}pct exec <ctid> -- getent passwd | column -t -s :${NC} - $(translate 'Show CT users in table format')"
read -r user_input echo -e "13) ${GREEN}pct exec <ctid> -- ps aux --sort=-%mem | head${NC} - $(translate 'Top memory processes in CT')"
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="qm list" ;; 1) cmd="qm list" ;;
2) cmd="pct list" ;; 2) cmd="pct list" ;;
3) cmd="qm start <vmid>" ;; 3) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm start $id" ;;
4) cmd="pct start <ctid>" ;; 4) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct start $id" ;;
5) cmd="qm stop <vmid>" ;; 5) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm stop $id" ;;
6) cmd="pct stop <ctid>" ;; 6) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct stop $id" ;;
7) cmd="qm config <vmid>" ;; 7) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm config $id" ;;
8) cmd="pct config <ctid>" ;; 8) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct config $id" ;;
9) cmd="qm destroy <vmid>" ;; 9) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"; read -r id; cmd="qm destroy $id" ;;
10) cmd="pct destroy <ctid>" ;; 10) echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"; read -r id; cmd="pct destroy $id" ;;
0) return ;; 11)
*) cmd="$user_input" ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
esac read -r id
echo -e " echo -e "\n${YELLOW}$(translate 'Listing relevant CT users and their mapped UID/GID on host...')${NC}\n"
${GREEN}> $cmd${NC}
" # Obtener el shift de UID del CT (por defecto 100000 si no está configurado)
bash -c "$cmd" UID_SHIFT=$(grep "^lxc.idmap" /etc/pve/lxc/"$id".conf | grep 'u 0' | awk '{print $5}')
echo UID_SHIFT=${UID_SHIFT:-100000}
msg_success "$(translate 'Press ENTER to return to the menu...')"
read -r tmp # Obtener todos los usuarios y filtrar solo root o UID >= 1000
pct exec "$id" -- getent passwd | while IFS=: read -r username _ uid gid _ home _; do
if [ "$uid" -eq 0 ] || [ "$uid" -ge 1000 ]; then
real_uid=$((UID_SHIFT + uid))
real_gid=$((UID_SHIFT + gid))
echo -e "${GREEN}$(translate 'User')${NC}: $username"
echo -e " $(translate 'UID in CT'): $uid"
echo -e " $(translate 'GID in CT'): $gid"
echo -e " $(translate 'Mapped UID on host'): $real_uid"
echo -e " $(translate 'Mapped GID on host'): $real_gid"
echo
fi
done
;;
12)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
read -r id
cmd="pct exec $id -- getent passwd | column -t -s :"
;;
13)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
read -r id
cmd="pct exec $id -- ps aux --sort=-%mem | head"
;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e "\n${GREEN}> $cmd${NC}\n"
bash -c "$cmd"
echo
msg_success "$(translate 'Press ENTER to continue...')"
read -r tmp
done
} }
@ -133,40 +203,40 @@ ${GREEN}> $cmd${NC}
# 03 Storage and Disks Commands # 03 Storage and Disks Commands
# =============================================================== # ===============================================================
show_storage_commands() { show_storage_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Storage and Disks Commands')${NC}" clear
echo "--------------------------------------------------" echo -e "${YELLOW}$(translate 'Storage and Disks Commands')${NC}"
echo -e " 1) ${GREEN}lsblk${NC} - $(translate 'List block devices and partitions')" echo "--------------------------------------------------"
echo -e " 2) ${GREEN}fdisk -l${NC} - $(translate 'List disks with detailed info')" echo -e " 1) ${GREEN}lsblk${NC} - $(translate 'List block devices and partitions')"
echo -e " 3) ${GREEN}df -h${NC} - $(translate 'Show disk usage by mount point')" echo -e " 2) ${GREEN}fdisk -l${NC} - $(translate 'List disks with detailed info')"
echo -e " 4) ${GREEN}pvdisplay${NC} - $(translate 'Display physical volumes (LVM)')" echo -e " 3) ${GREEN}df -h${NC} - $(translate 'Show disk usage by mount point')"
echo -e " 5) ${GREEN}vgdisplay${NC} - $(translate 'Display volume groups (LVM)')" echo -e " 4) ${GREEN}pvdisplay${NC} - $(translate 'Display physical volumes (LVM)')"
echo -e " 6) ${GREEN}lvdisplay${NC} - $(translate 'Display logical volumes (LVM)')" echo -e " 5) ${GREEN}vgdisplay${NC} - $(translate 'Display volume groups (LVM)')"
echo -e " 7) ${GREEN}cat /etc/pve/storage.cfg${NC} - $(translate 'Show Proxmox storage configuration')" echo -e " 6) ${GREEN}lvdisplay${NC} - $(translate 'Display logical volumes (LVM)')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 7) ${GREEN}cat /etc/pve/storage.cfg${NC} - $(translate 'Show Proxmox storage configuration')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="lsblk" ;; 1) cmd="lsblk" ;;
2) cmd="fdisk -l" ;; 2) cmd="fdisk -l" ;;
3) cmd="df -h" ;; 3) cmd="df -h" ;;
4) cmd="pvdisplay" ;; 4) cmd="pvdisplay" ;;
5) cmd="vgdisplay" ;; 5) cmd="vgdisplay" ;;
6) cmd="lvdisplay" ;; 6) cmd="lvdisplay" ;;
7) cmd="cat /etc/pve/storage.cfg" ;; 7) cmd="cat /etc/pve/storage.cfg" ;;
0) return ;; 0) break ;;
*) cmd="$user_input" ;; *) cmd="$user_input" ;;
esac esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
@ -174,75 +244,80 @@ ${GREEN}> $cmd${NC}
# 04 Network Commands # 04 Network Commands
# =============================================================== # ===============================================================
show_network_commands() { show_network_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Network Commands')${NC}" clear
echo "------------------------------------------" echo -e "${YELLOW}$(translate 'Network Commands')${NC}"
echo -e " 1) ${GREEN}ip a${NC} - $(translate 'Show network interfaces and IPs')" echo "------------------------------------------"
echo -e " 2) ${GREEN}ip r${NC} - $(translate 'Show routing table')" echo -e " 1) ${GREEN}ip a${NC} - $(translate 'Show network interfaces and IPs')"
echo -e " 3) ${GREEN}ping <host>${NC} - $(translate 'Check connectivity with another host')" echo -e " 2) ${GREEN}ip r${NC} - $(translate 'Show routing table')"
echo -e " 4) ${GREEN}brctl show${NC} - $(translate 'Show configured network bridges')" echo -e " 3) ${GREEN}ping <host>${NC} - $(translate 'Check connectivity with another host')"
echo -e " 5) ${GREEN}ifreload -a${NC} - $(translate 'Reload network configuration (ifupdown2)')" echo -e " 4) ${GREEN}brctl show${NC} - $(translate 'Show configured network bridges')"
echo -e " 6) ${GREEN}cat /etc/network/interfaces${NC} - $(translate 'Show raw network configuration')" echo -e " 5) ${GREEN}ifreload -a${NC} - $(translate 'Reload network configuration (ifupdown2)')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 6) ${GREEN}cat /etc/network/interfaces${NC} - $(translate 'Show raw network configuration')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="ip a" ;; 1) cmd="ip a" ;;
2) cmd="ip r" ;; 2) cmd="ip r" ;;
3) cmd="ping <host>" ;; 3)
4) cmd="brctl show" ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter host or IP: ')${CL}"
5) cmd="ifreload -a" ;; read -r host
6) cmd="cat /etc/network/interfaces" ;; cmd="ping $host"
0) return ;; ;;
*) cmd="$user_input" ;; 4) cmd="brctl show" ;;
esac 5) cmd="ifreload -a" ;;
6) cmd="cat /etc/network/interfaces" ;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
# =============================================================== # ===============================================================
# 05 Updates and Packages Commands # 05 Updates and Packages Commands
# =============================================================== # ===============================================================
show_update_commands() { show_update_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Updates and Packages Commands')${NC}" clear
echo "----------------------------------------------------" echo -e "${YELLOW}$(translate 'Updates and Packages Commands')${NC}"
echo -e " 1) ${GREEN}apt update && apt upgrade -y${NC} - $(translate 'Update and upgrade all system packages')" echo "----------------------------------------------------"
echo -e " 2) ${GREEN}apt dist-upgrade -y${NC} - $(translate 'Full system upgrade, including dependencies')" echo -e " 1) ${GREEN}apt update && apt upgrade -y${NC} - $(translate 'Update and upgrade all system packages')"
echo -e " 3) ${GREEN}pveupdate${NC} - $(translate 'Update Proxmox package lists')" echo -e " 2) ${GREEN}apt dist-upgrade -y${NC} - $(translate 'Full system upgrade, including dependencies')"
echo -e " 4) ${GREEN}pveupgrade${NC} - $(translate 'Show available Proxmox upgrades')" echo -e " 3) ${GREEN}pveupdate${NC} - $(translate 'Update Proxmox package lists')"
echo -e " 5) ${GREEN}apt autoremove --purge${NC} - $(translate 'Remove unused packages and their config')" echo -e " 4) ${GREEN}pveupgrade${NC} - $(translate 'Show available Proxmox upgrades')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 5) ${GREEN}apt autoremove --purge${NC} - $(translate 'Remove unused packages and their config')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="apt update && apt upgrade -y" ;; 1) cmd="apt update && apt upgrade -y" ;;
2) cmd="apt dist-upgrade -y" ;; 2) cmd="apt dist-upgrade -y" ;;
3) cmd="pveupdate" ;; 3) cmd="pveupdate" ;;
4) cmd="pveupgrade" ;; 4) cmd="pveupgrade" ;;
5) cmd="apt autoremove --purge" ;; 5) cmd="apt autoremove --purge" ;;
0) return ;; 0) break ;;
*) cmd="$user_input" ;; *) cmd="$user_input" ;;
esac esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
@ -250,156 +325,247 @@ ${GREEN}> $cmd${NC}
# 06 GPU Passthrough Commands # 06 GPU Passthrough Commands
# =============================================================== # ===============================================================
show_gpu_commands() { show_gpu_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'GPU Passthrough Commands')${NC}" clear
echo "------------------------------------------------" echo -e "${YELLOW}$(translate 'GPU Passthrough Commands')${NC}"
echo -e " 1) ${GREEN}lspci -nn | grep -i nvidia${NC} - $(translate 'List NVIDIA PCI devices')" echo "------------------------------------------------"
echo -e " 2) ${GREEN}lspci -nn | grep -i vga${NC} - $(translate 'List all VGA compatible devices')" echo -e " 1) ${GREEN}lspci -nn | grep -i nvidia${NC} - $(translate 'List NVIDIA PCI devices')"
echo -e " 3) ${GREEN}dmesg | grep -i vfio${NC} - $(translate 'Check VFIO module messages')" echo -e " 2) ${GREEN}lspci -nn | grep -i vga${NC} - $(translate 'List all VGA compatible devices')"
echo -e " 4) ${GREEN}cat /etc/modprobe.d/vfio.conf${NC} - $(translate 'Review VFIO passthrough configuration')" echo -e " 3) ${GREEN}dmesg | grep -i vfio${NC} - $(translate 'Check VFIO module messages')"
echo -e " 5) ${GREEN}update-initramfs -u${NC} - $(translate 'Apply initramfs changes (VFIO)')" echo -e " 4) ${GREEN}cat /etc/modprobe.d/vfio.conf${NC} - $(translate 'Review VFIO passthrough configuration')"
echo -e " 6) ${GREEN}cat /etc/default/grub${NC} - $(translate 'Review GRUB options for IOMMU')" echo -e " 5) ${GREEN}update-initramfs -u${NC} - $(translate 'Apply initramfs changes (VFIO)')"
echo -e " 7) ${GREEN}update-grub${NC} - $(translate 'Apply GRUB changes')" echo -e " 6) ${GREEN}cat /etc/default/grub${NC} - $(translate 'Review GRUB options for IOMMU')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 7) ${GREEN}update-grub${NC} - $(translate 'Apply GRUB changes')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="lspci -nn | grep -i nvidia" ;; 1) cmd="lspci -nn | grep -i nvidia" ;;
2) cmd="lspci -nn | grep -i vga" ;; 2) cmd="lspci -nn | grep -i vga" ;;
3) cmd="dmesg | grep -i vfio" ;; 3) cmd="dmesg | grep -i vfio" ;;
4) cmd="cat /etc/modprobe.d/vfio.conf" ;; 4) cmd="cat /etc/modprobe.d/vfio.conf" ;;
5) cmd="update-initramfs -u" ;; 5) cmd="update-initramfs -u" ;;
6) cmd="cat /etc/default/grub" ;; 6) cmd="cat /etc/default/grub" ;;
7) cmd="update-grub" ;; 7) cmd="update-grub" ;;
0) return ;; 0) break ;;
*) cmd="$user_input" ;; *) cmd="$user_input" ;;
esac esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
# =============================================================== # ===============================================================
# 07 ZFS Management Commands # 07 ZFS Management Commands
# =============================================================== # ===============================================================
show_zfs_commands() { show_zfs_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'ZFS Management Commands')${NC}" clear
echo "------------------------------------------------" echo -e "${YELLOW}$(translate 'ZFS Management Commands')${NC}"
echo -e " 1) ${GREEN}zpool status${NC} - $(translate 'Show ZFS pool status')" echo "------------------------------------------------"
echo -e " 2) ${GREEN}zpool list${NC} - $(translate 'List all ZFS pools')" echo -e " 1) ${GREEN}zpool status${NC} - $(translate 'Show ZFS pool status')"
echo -e " 3) ${GREEN}zfs list${NC} - $(translate 'List ZFS datasets and snapshots')" echo -e " 2) ${GREEN}zpool list${NC} - $(translate 'List all ZFS pools')"
echo -e " 4) ${GREEN}zpool scrub <pool>${NC} - $(translate 'Start scrub for a ZFS pool')" echo -e " 3) ${GREEN}zfs list${NC} - $(translate 'List ZFS datasets and snapshots')"
echo -e " 5) ${GREEN}zfs create <pool>/dataset${NC} - $(translate 'Create a new dataset in a ZFS pool')" echo -e " 4) ${GREEN}zpool scrub <pool>${NC} - $(translate 'Start scrub for a ZFS pool')"
echo -e " 6) ${GREEN}zfs destroy <pool>/dataset${NC} - $(translate 'Destroy a ZFS dataset (irreversible)')" echo -e " 5) ${GREEN}zfs create <pool>/dataset${NC} - $(translate 'Create a new dataset in a ZFS pool')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 6) ${GREEN}zfs destroy <pool>/dataset${NC} - $(translate 'Destroy a ZFS dataset (irreversible)')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="zpool status" ;; 1) cmd="zpool status" ;;
2) cmd="zpool list" ;; 2) cmd="zpool list" ;;
3) cmd="zfs list" ;; 3) cmd="zfs list" ;;
4) cmd="zpool scrub <pool>" ;; 4)
5) cmd="zfs create <pool>/dataset" ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter pool name: ')${CL}"
6) cmd="zfs destroy <pool>/dataset" ;; read -r pool
0) return ;; cmd="zpool scrub $pool"
*) cmd="$user_input" ;; ;;
esac 5)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter pool/dataset name: ')${CL}"
read -r dataset
cmd="zfs create $dataset"
;;
6)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter pool/dataset to destroy: ')${CL}"
read -r dataset
cmd="zfs destroy $dataset"
;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e "\n${GREEN}> $cmd${NC}\n" echo -e "\n${GREEN}> $cmd${NC}\n"
bash -c "$cmd" bash -c "$cmd"
echo echo
msg_success "$(translate 'Press ENTER to return to the menu...')" msg_success "$(translate 'Press ENTER to continue...')"
read -r tmp read -r tmp
done
} }
# =============================================================== # ===============================================================
# 08 Backup and Restore Commands # 08 Backup and Restore Commands
# =============================================================== # ===============================================================
show_backup_commands() { show_backup_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Backup and Restore Commands')${NC}" clear
echo "------------------------------------------------------" echo -e "${YELLOW}$(translate 'Backup and Restore Commands')${NC}"
echo -e " 1) ${GREEN}vzdump <vmid>${NC} - $(translate 'Manual backup of a VM or CT')" echo "------------------------------------------------------"
echo -e " 2) ${GREEN}vzdump <vmid> --dumpdir /path${NC} - $(translate 'Backup to a specific directory')" echo -e " 1) ${GREEN}vzdump <vmid>${NC} - $(translate 'Manual backup of a VM or CT')"
echo -e " 3) ${GREEN}vzdump --all${NC} - $(translate 'Backup all VMs and CTs')" echo -e " 2) ${GREEN}vzdump <vmid> --dumpdir /path${NC} - $(translate 'Backup to a specific directory')"
echo -e " 4) ${GREEN}qmrestore /path/backup.vma.zst <vmid>${NC} - $(translate 'Restore a VM from backup')" echo -e " 3) ${GREEN}vzdump --all${NC} - $(translate 'Backup all VMs and CTs')"
echo -e " 5) ${GREEN}pct restore <vmid> /path/backup.tar.zst${NC} - $(translate 'Restore a CT from backup')" echo -e " 4) ${GREEN}qmrestore /path/backup.vma.zst <vmid>${NC} - $(translate 'Restore a VM from backup')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 5) ${GREEN}pct restore <vmid> /path/backup.tar.zst${NC} - $(translate 'Restore a CT from backup')"
echo echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo
read -r user_input echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="vzdump <vmid>" ;; 1)
2) cmd="vzdump <vmid> --dumpdir /path" ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM/CT ID: ')${CL}"
3) cmd="vzdump --all" ;; read -r id
4) cmd="qmrestore /path/backup.vma.zst <vmid>" ;; cmd="vzdump $id"
5) cmd="pct restore <vmid> /path/backup.tar.zst" ;; ;;
0) return ;; 2)
*) cmd="$user_input" ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM/CT ID: ')${CL}"
esac read -r id
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter destination path: ')${CL}"
read -r path
cmd="vzdump $id --dumpdir $path"
;;
3) cmd="vzdump --all" ;;
4)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter backup path (.vma.zst): ')${CL}"
read -r backup
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM ID: ')${CL}"
read -r id
cmd="qmrestore $backup $id"
;;
5)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter backup path (.tar.zst): ')${CL}"
read -r backup
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
read -r id
cmd="pct restore $id $backup"
;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e " echo -e "\n${GREEN}> $cmd${NC}\n"
${GREEN}> $cmd${NC} bash -c "$cmd"
" echo
bash -c "$cmd" msg_success "$(translate 'Press ENTER to continue...')"
echo read -r tmp
msg_success "$(translate 'Press ENTER to return to the menu...')" done
read -r tmp
} }
# =============================================================== # ===============================================================
# 09 Essential Tools Installation Commands # 09 System CLI Tools Commands
# =============================================================== # ===============================================================
show_tools_commands() { show_tools_commands() {
clear while true; do
echo -e "${YELLOW}$(translate 'Essential CLI Tools')${NC}" clear
echo "--------------------------------------------" echo -e "${YELLOW}$(translate 'System CLI Tools')${NC}"
echo -e " 1) ${GREEN}htop${NC} - $(translate 'Interactive process viewer')" echo "--------------------------------------------"
echo -e " 2) ${GREEN}btop${NC} - $(translate 'Modern resource monitor')" echo -e " 1) ${GREEN}htop${NC} - $(translate 'Interactive process viewer (press q to exit)')"
echo -e " 3) ${GREEN}iftop${NC} - $(translate 'Real-time bandwidth usage')" echo -e " 2) ${GREEN}btop${NC} - $(translate 'Modern resource monitor (press q to exit)')"
echo -e " 4) ${GREEN}iotop${NC} - $(translate 'Monitor disk I/O usage')" echo -e " 3) ${GREEN}iftop${NC} - $(translate 'Real-time bandwidth usage (press q to exit)')"
echo -e " 5) ${GREEN}tmux${NC} - $(translate 'Terminal multiplexer')" echo -e " 4) ${GREEN}iotop${NC} - $(translate 'Monitor disk I/O usage (press q to exit)')"
echo -e " 6) ${GREEN}iperf3${NC} - $(translate 'Network throughput test')" echo -e " 5) ${GREEN}tmux${NC} - $(translate 'Terminal multiplexer (Ctrl+b then d to detach, or type exit)')"
echo -e " 0) $(translate 'Back to previous menu')" echo -e " 6) ${GREEN}iperf3${NC} - $(translate 'Network throughput test (client/server)')"
echo echo -e " 7) ${GREEN}iptraf-ng${NC} - $(translate 'Real-time network monitoring (press q to exit)')"
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}" echo -e " 8) ${GREEN}msr-tools${NC} - $(translate 'Read/write CPU model-specific registers')"
read -r user_input echo -e " 9) ${GREEN}net-tools${NC} - $(translate 'Legacy network tools (e.g., ifconfig)')"
echo -e "10) ${GREEN}whois${NC} - $(translate 'Lookup domain registration info')"
echo -e "11) ${GREEN}libguestfs-tools${NC} - $(translate 'Manage and inspect VM disk images')"
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
echo
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
read -r user_input
case "$user_input" in case "$user_input" in
1) cmd="htop" ;; 1) cmd="htop" ;;
2) cmd="btop" ;; 2) cmd="btop" ;;
3) cmd="iftop" ;; 3) cmd="iftop" ;;
4) cmd="iotop" ;; 4) cmd="iotop" ;;
5) cmd="tmux" ;; 5) cmd="tmux" ;;
6) cmd="iperf3" ;; 6)
0) return ;; echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Run as server or client? [s/c]: ')${CL}"
*) cmd="$user_input" ;; read -r mode
esac if [[ "$mode" == "s" ]]; then
cmd="iperf3 -s"
elif [[ "$mode" == "c" ]]; then
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter server IP: ')${CL}"
read -r server_ip
cmd="iperf3 -c $server_ip"
else
msg_info2 "$(translate 'Invalid option. Skipping.')"
read -r
continue
fi
;;
7) cmd="iptraf-ng" ;;
8)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter MSR register (e.g. 0x10): ')${CL}"
read -r reg
cmd="rdmsr $reg"
;;
9) cmd="ifconfig -a" ;;
10)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter domain: ')${CL}"
read -r domain
cmd="whois $domain"
;;
11)
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter disk image path: ')${CL}"
read -r path
cmd="virt-inspector $path"
;;
0) break ;;
*) cmd="$user_input" ;;
esac
echo -e " if ! command -v $(echo "$cmd" | awk '{print $1}') &>/dev/null; then
${GREEN}> $cmd${NC} if whiptail --yesno "$(translate "$cmd is not installed. Do you want to install it now?")" 10 60; then
" msg_info "$(translate "Installing") $cmd..."
bash -c "$cmd" apt update -qq >/dev/null 2>&1
echo apt install -y $(echo "$cmd" | awk '{print $1}') >/dev/null 2>&1
msg_success "$(translate 'Press ENTER to return to the menu...')" msg_ok "$(translate "$cmd installed successfully")"
read -r tmp sleep 2
else
msg_info2 "$(translate 'Skipping installation.')"
read -r
continue
fi
fi
echo -e "\n${GREEN}> $cmd${NC}\n"
bash -c "$cmd"
echo
msg_success "$(translate 'Press ENTER to continue...')"
read -r tmp
done
} }
# =============================================================== # ===============================================================
# Main Menu # Main Menu
# =============================================================== # ===============================================================
@ -415,7 +581,7 @@ OPTION=$(dialog --stdout \
6 "$(translate 'GPU Passthrough Commands')" \ 6 "$(translate 'GPU Passthrough Commands')" \
7 "$(translate 'ZFS Management Commands')" \ 7 "$(translate 'ZFS Management Commands')" \
8 "$(translate 'Backup and Restore Commands')" \ 8 "$(translate 'Backup and Restore Commands')" \
9 "$(translate 'Essential CLI Tools')" \ 9 "$(translate 'System CLI Tools')" \
0 "$(translate 'Exit')") 0 "$(translate 'Exit')")
case $OPTION in case $OPTION in
1) 1)

View File

@ -52,8 +52,18 @@ export default function Footer() {
{/* Copyright - Center */} {/* Copyright - Center */}
<div className="mt-8 pt-8 border-t border-gray-800 text-center text-gray-400"> <div className="mt-8 pt-8 border-t border-gray-800 text-center text-gray-400">
<p>ProxMenux, an open-source and collaborative project by MacRimi.</p> <p>
</div> ProxMenux, an open-source and collaborative project by{' '}
<a
href="https://github.com/MacRimi"
target="_blank"
rel="noopener noreferrer"
className="text-blue-400 hover:underline"
>
MacRimi
</a>.
</p>
</div>
</div> </div>
</footer> </footer>
) )

View File

@ -49,8 +49,18 @@ export default function Footer() {
{/* Copyright - Center */} {/* Copyright - Center */}
<div className="mt-8 pt-8 border-t border-gray-800 text-center text-gray-400"> <div className="mt-8 pt-8 border-t border-gray-800 text-center text-gray-400">
<p>ProxMenux, an open-source and collaborative project by MacRimi.</p> <p>
</div> ProxMenux, an open-source and collaborative project by{' '}
<a
href="https://github.com/MacRimi"
target="_blank"
rel="noopener noreferrer"
className="text-blue-400 hover:underline"
>
MacRimi
</a>.
</p>
</div>
</div> </div>
</footer> </footer>
) )

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB