mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 12:16:53 +00:00
update footer
This commit is contained in:
parent
2d04f38134
commit
6c45535875
@ -47,6 +47,7 @@ fi
|
|||||||
# 01 Useful System Commands
|
# 01 Useful System Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_system_commands() {
|
show_system_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Useful System Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'Useful System Commands')${NC}"
|
||||||
echo "----------------------------------------"
|
echo "----------------------------------------"
|
||||||
@ -56,9 +57,24 @@ show_system_commands() {
|
|||||||
echo -e " 4) ${GREEN}systemctl restart pveproxy${NC} - $(translate 'Restart Web UI proxy')"
|
echo -e " 4) ${GREEN}systemctl restart pveproxy${NC} - $(translate 'Restart Web UI proxy')"
|
||||||
echo -e " 5) ${GREEN}journalctl -xe${NC} - $(translate 'System errors and logs')"
|
echo -e " 5) ${GREEN}journalctl -xe${NC} - $(translate 'System errors and logs')"
|
||||||
echo -e " 6) ${GREEN}uptime${NC} - $(translate 'System uptime')"
|
echo -e " 6) ${GREEN}uptime${NC} - $(translate 'System uptime')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " 7) ${GREEN}hostnamectl${NC} - $(translate 'System hostname and kernel info')"
|
||||||
|
echo -e " 8) ${GREEN}free -h${NC} - $(translate 'RAM and swap usage')"
|
||||||
|
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
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
read -r user_input
|
||||||
|
|
||||||
case "$user_input" in
|
case "$user_input" in
|
||||||
@ -68,64 +84,118 @@ show_system_commands() {
|
|||||||
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" ;;
|
||||||
|
9) cmd="uptime -p" ;;
|
||||||
|
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" ;;
|
*) cmd="$user_input" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo -e "
|
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||||
${GREEN}> $cmd${NC}
|
|
||||||
"
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# 02 VM and CT Management Commands
|
# 02 VM and CT Management Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_vm_ct_commands() {
|
show_vm_ct_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'VM and CT Management Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'VM and CT Management Commands')${NC}"
|
||||||
echo "---------------------------------------------------"
|
echo "---------------------------------------------------"
|
||||||
echo -e " 1) ${GREEN}qm list${NC} - $(translate 'List all virtual machines')"
|
echo -e " 1) ${GREEN}qm list${NC} - $(translate 'List all virtual machines')"
|
||||||
echo -e " 2) ${GREEN}pct list${NC} - $(translate 'List all LXC containers')"
|
echo -e " 2) ${GREEN}pct list${NC} - $(translate 'List all LXC containers')"
|
||||||
echo -e " 3) ${GREEN}qm start <vmid>${NC} - $(translate 'Start a virtual machine. Replace <vmid> with the correct ID')"
|
echo -e " 3) ${GREEN}qm start <vmid>${NC} - $(translate 'Start a virtual machine. Use the correct <vmid>')"
|
||||||
echo -e " 4) ${GREEN}pct start <ctid>${NC} - $(translate 'Start a container. Replace <ctid> with the correct ID')"
|
echo -e " 4) ${GREEN}pct start <ctid>${NC} - $(translate 'Start a container. Use the correct <ctid>')"
|
||||||
echo -e " 5) ${GREEN}qm stop <vmid>${NC} - $(translate 'Force stop a virtual machine. Replace <vmid> with the correct ID')"
|
echo -e " 5) ${GREEN}qm stop <vmid>${NC} - $(translate 'Force stop a virtual machine. Use the correct <vmid>')"
|
||||||
echo -e " 6) ${GREEN}pct stop <ctid>${NC} - $(translate 'Force stop a container. Replace <ctid> with the correct ID')"
|
echo -e " 6) ${GREEN}pct stop <ctid>${NC} - $(translate 'Force stop a container. Use the correct <ctid>')"
|
||||||
echo -e " 7) ${GREEN}qm config <vmid>${NC} - $(translate 'Show VM configuration. Replace <vmid> with the correct ID')"
|
echo -e " 7) ${GREEN}qm config <vmid>${NC} - $(translate 'Show VM configuration. Use the correct <vmid>')"
|
||||||
echo -e " 8) ${GREEN}pct config <ctid>${NC} - $(translate 'Show container configuration. Replace <ctid> with the correct ID')"
|
echo -e " 8) ${GREEN}pct config <ctid>${NC} - $(translate 'Show container configuration. Use the correct <ctid>')"
|
||||||
echo -e " 9) ${GREEN}qm destroy <vmid>${NC} - $(translate 'Delete a VM (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 " 10) ${GREEN}pct destroy <ctid>${NC} - $(translate 'Delete a CT (irreversible). Replace <vmid> with the correct ID')"
|
echo -e "10) ${GREEN}pct destroy <ctid>${NC} - $(translate 'Delete a CT (irreversible). Use the correct <ctid>')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e "11) ${GN}[Only with menu] Show CT users for permission mapping${NC} - $(translate 'root and real users only')"
|
||||||
|
echo -e "12) ${GREEN}pct exec <ctid> -- getent passwd | column -t -s :${NC} - $(translate 'Show CT users in table format')"
|
||||||
|
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
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
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)
|
||||||
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter CT ID: ')${CL}"
|
||||||
|
read -r id
|
||||||
|
|
||||||
|
echo -e "\n${YELLOW}$(translate 'Listing relevant CT users and their mapped UID/GID on host...')${NC}\n"
|
||||||
|
|
||||||
|
# Obtener el shift de UID del CT (por defecto 100000 si no está configurado)
|
||||||
|
UID_SHIFT=$(grep "^lxc.idmap" /etc/pve/lxc/"$id".conf | grep 'u 0' | awk '{print $5}')
|
||||||
|
UID_SHIFT=${UID_SHIFT:-100000}
|
||||||
|
|
||||||
|
# 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" ;;
|
*) cmd="$user_input" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo -e "
|
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||||
${GREEN}> $cmd${NC}
|
|
||||||
"
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -133,6 +203,7 @@ ${GREEN}> $cmd${NC}
|
|||||||
# 03 Storage and Disks Commands
|
# 03 Storage and Disks Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_storage_commands() {
|
show_storage_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Storage and Disks Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'Storage and Disks Commands')${NC}"
|
||||||
echo "--------------------------------------------------"
|
echo "--------------------------------------------------"
|
||||||
@ -143,9 +214,9 @@ show_storage_commands() {
|
|||||||
echo -e " 5) ${GREEN}vgdisplay${NC} - $(translate 'Display volume groups (LVM)')"
|
echo -e " 5) ${GREEN}vgdisplay${NC} - $(translate 'Display volume groups (LVM)')"
|
||||||
echo -e " 6) ${GREEN}lvdisplay${NC} - $(translate 'Display logical volumes (LVM)')"
|
echo -e " 6) ${GREEN}lvdisplay${NC} - $(translate 'Display logical volumes (LVM)')"
|
||||||
echo -e " 7) ${GREEN}cat /etc/pve/storage.cfg${NC} - $(translate 'Show Proxmox storage configuration')"
|
echo -e " 7) ${GREEN}cat /etc/pve/storage.cfg${NC} - $(translate 'Show Proxmox storage configuration')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
read -r user_input
|
||||||
|
|
||||||
case "$user_input" in
|
case "$user_input" in
|
||||||
@ -156,17 +227,16 @@ show_storage_commands() {
|
|||||||
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"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -174,6 +244,7 @@ ${GREEN}> $cmd${NC}
|
|||||||
# 04 Network Commands
|
# 04 Network Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_network_commands() {
|
show_network_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Network Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'Network Commands')${NC}"
|
||||||
echo "------------------------------------------"
|
echo "------------------------------------------"
|
||||||
@ -183,36 +254,41 @@ show_network_commands() {
|
|||||||
echo -e " 4) ${GREEN}brctl show${NC} - $(translate 'Show configured network bridges')"
|
echo -e " 4) ${GREEN}brctl show${NC} - $(translate 'Show configured network bridges')"
|
||||||
echo -e " 5) ${GREEN}ifreload -a${NC} - $(translate 'Reload network configuration (ifupdown2)')"
|
echo -e " 5) ${GREEN}ifreload -a${NC} - $(translate 'Reload network configuration (ifupdown2)')"
|
||||||
echo -e " 6) ${GREEN}cat /etc/network/interfaces${NC} - $(translate 'Show raw network configuration')"
|
echo -e " 6) ${GREEN}cat /etc/network/interfaces${NC} - $(translate 'Show raw network configuration')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
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)
|
||||||
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter host or IP: ')${CL}"
|
||||||
|
read -r host
|
||||||
|
cmd="ping $host"
|
||||||
|
;;
|
||||||
4) cmd="brctl show" ;;
|
4) cmd="brctl show" ;;
|
||||||
5) cmd="ifreload -a" ;;
|
5) cmd="ifreload -a" ;;
|
||||||
6) cmd="cat /etc/network/interfaces" ;;
|
6) cmd="cat /etc/network/interfaces" ;;
|
||||||
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"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# 05 Updates and Packages Commands
|
# 05 Updates and Packages Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_update_commands() {
|
show_update_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Updates and Packages Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'Updates and Packages Commands')${NC}"
|
||||||
echo "----------------------------------------------------"
|
echo "----------------------------------------------------"
|
||||||
@ -221,9 +297,9 @@ show_update_commands() {
|
|||||||
echo -e " 3) ${GREEN}pveupdate${NC} - $(translate 'Update Proxmox package lists')"
|
echo -e " 3) ${GREEN}pveupdate${NC} - $(translate 'Update Proxmox package lists')"
|
||||||
echo -e " 4) ${GREEN}pveupgrade${NC} - $(translate 'Show available Proxmox upgrades')"
|
echo -e " 4) ${GREEN}pveupgrade${NC} - $(translate 'Show available Proxmox upgrades')"
|
||||||
echo -e " 5) ${GREEN}apt autoremove --purge${NC} - $(translate 'Remove unused packages and their config')"
|
echo -e " 5) ${GREEN}apt autoremove --purge${NC} - $(translate 'Remove unused packages and their config')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
read -r user_input
|
||||||
|
|
||||||
case "$user_input" in
|
case "$user_input" in
|
||||||
@ -232,17 +308,16 @@ show_update_commands() {
|
|||||||
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"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -250,6 +325,7 @@ ${GREEN}> $cmd${NC}
|
|||||||
# 06 GPU Passthrough Commands
|
# 06 GPU Passthrough Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_gpu_commands() {
|
show_gpu_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'GPU Passthrough Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'GPU Passthrough Commands')${NC}"
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
@ -260,9 +336,9 @@ show_gpu_commands() {
|
|||||||
echo -e " 5) ${GREEN}update-initramfs -u${NC} - $(translate 'Apply initramfs changes (VFIO)')"
|
echo -e " 5) ${GREEN}update-initramfs -u${NC} - $(translate 'Apply initramfs changes (VFIO)')"
|
||||||
echo -e " 6) ${GREEN}cat /etc/default/grub${NC} - $(translate 'Review GRUB options for IOMMU')"
|
echo -e " 6) ${GREEN}cat /etc/default/grub${NC} - $(translate 'Review GRUB options for IOMMU')"
|
||||||
echo -e " 7) ${GREEN}update-grub${NC} - $(translate 'Apply GRUB changes')"
|
echo -e " 7) ${GREEN}update-grub${NC} - $(translate 'Apply GRUB changes')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
read -r user_input
|
||||||
|
|
||||||
case "$user_input" in
|
case "$user_input" in
|
||||||
@ -273,24 +349,25 @@ show_gpu_commands() {
|
|||||||
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"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# 07 ZFS Management Commands
|
# 07 ZFS Management Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_zfs_commands() {
|
show_zfs_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'ZFS Management Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'ZFS Management Commands')${NC}"
|
||||||
echo "------------------------------------------------"
|
echo "------------------------------------------------"
|
||||||
@ -300,34 +377,49 @@ show_zfs_commands() {
|
|||||||
echo -e " 4) ${GREEN}zpool scrub <pool>${NC} - $(translate 'Start scrub for a ZFS pool')"
|
echo -e " 4) ${GREEN}zpool scrub <pool>${NC} - $(translate 'Start scrub for a ZFS pool')"
|
||||||
echo -e " 5) ${GREEN}zfs create <pool>/dataset${NC} - $(translate 'Create a new dataset in a ZFS pool')"
|
echo -e " 5) ${GREEN}zfs create <pool>/dataset${NC} - $(translate 'Create a new dataset in a ZFS pool')"
|
||||||
echo -e " 6) ${GREEN}zfs destroy <pool>/dataset${NC} - $(translate 'Destroy a ZFS dataset (irreversible)')"
|
echo -e " 6) ${GREEN}zfs destroy <pool>/dataset${NC} - $(translate 'Destroy a ZFS dataset (irreversible)')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
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"
|
||||||
|
;;
|
||||||
|
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" ;;
|
*) cmd="$user_input" ;;
|
||||||
esac
|
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() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Backup and Restore Commands')${NC}"
|
echo -e "${YELLOW}$(translate 'Backup and Restore Commands')${NC}"
|
||||||
echo "------------------------------------------------------"
|
echo "------------------------------------------------------"
|
||||||
@ -336,47 +428,75 @@ show_backup_commands() {
|
|||||||
echo -e " 3) ${GREEN}vzdump --all${NC} - $(translate 'Backup all VMs and CTs')"
|
echo -e " 3) ${GREEN}vzdump --all${NC} - $(translate 'Backup all VMs and CTs')"
|
||||||
echo -e " 4) ${GREEN}qmrestore /path/backup.vma.zst <vmid>${NC} - $(translate 'Restore a VM from backup')"
|
echo -e " 4) ${GREEN}qmrestore /path/backup.vma.zst <vmid>${NC} - $(translate 'Restore a VM from backup')"
|
||||||
echo -e " 5) ${GREEN}pct restore <vmid> /path/backup.tar.zst${NC} - $(translate 'Restore a CT from backup')"
|
echo -e " 5) ${GREEN}pct restore <vmid> /path/backup.tar.zst${NC} - $(translate 'Restore a CT from backup')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " ${DEF}0)$(translate ' Back to previous menu')${CL}"
|
||||||
echo
|
echo
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
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}"
|
||||||
|
read -r id
|
||||||
|
cmd="vzdump $id"
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter VM/CT ID: ')${CL}"
|
||||||
|
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" ;;
|
3) cmd="vzdump --all" ;;
|
||||||
4) cmd="qmrestore /path/backup.vma.zst <vmid>" ;;
|
4)
|
||||||
5) cmd="pct restore <vmid> /path/backup.tar.zst" ;;
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter backup path (.vma.zst): ')${CL}"
|
||||||
0) return ;;
|
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" ;;
|
*) cmd="$user_input" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo -e "
|
echo -e "\n${GREEN}> $cmd${NC}\n"
|
||||||
${GREEN}> $cmd${NC}
|
|
||||||
"
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# 09 Essential Tools Installation Commands
|
# 09 System CLI Tools Commands
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
show_tools_commands() {
|
show_tools_commands() {
|
||||||
|
while true; do
|
||||||
clear
|
clear
|
||||||
echo -e "${YELLOW}$(translate 'Essential CLI Tools')${NC}"
|
echo -e "${YELLOW}$(translate 'System CLI Tools')${NC}"
|
||||||
echo "--------------------------------------------"
|
echo "--------------------------------------------"
|
||||||
echo -e " 1) ${GREEN}htop${NC} - $(translate 'Interactive process viewer')"
|
echo -e " 1) ${GREEN}htop${NC} - $(translate 'Interactive process viewer (press q to exit)')"
|
||||||
echo -e " 2) ${GREEN}btop${NC} - $(translate 'Modern resource monitor')"
|
echo -e " 2) ${GREEN}btop${NC} - $(translate 'Modern resource monitor (press q to exit)')"
|
||||||
echo -e " 3) ${GREEN}iftop${NC} - $(translate 'Real-time bandwidth usage')"
|
echo -e " 3) ${GREEN}iftop${NC} - $(translate 'Real-time bandwidth usage (press q to exit)')"
|
||||||
echo -e " 4) ${GREEN}iotop${NC} - $(translate 'Monitor disk I/O usage')"
|
echo -e " 4) ${GREEN}iotop${NC} - $(translate 'Monitor disk I/O usage (press q to exit)')"
|
||||||
echo -e " 5) ${GREEN}tmux${NC} - $(translate 'Terminal multiplexer')"
|
echo -e " 5) ${GREEN}tmux${NC} - $(translate 'Terminal multiplexer (Ctrl+b then d to detach, or type exit)')"
|
||||||
echo -e " 6) ${GREEN}iperf3${NC} - $(translate 'Network throughput test')"
|
echo -e " 6) ${GREEN}iperf3${NC} - $(translate 'Network throughput test (client/server)')"
|
||||||
echo -e " 0) $(translate 'Back to previous menu')"
|
echo -e " 7) ${GREEN}iptraf-ng${NC} - $(translate 'Real-time network monitoring (press q to exit)')"
|
||||||
|
echo -e " 8) ${GREEN}msr-tools${NC} - $(translate 'Read/write CPU model-specific registers')"
|
||||||
|
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
|
||||||
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter number or paste a command: ') ${CL}"
|
echo -en "${TAB}${BOLD}${YW}${HOLD}$(translate 'Enter a number, or write or paste a command.: ') ${CL}"
|
||||||
read -r user_input
|
read -r user_input
|
||||||
|
|
||||||
case "$user_input" in
|
case "$user_input" in
|
||||||
@ -385,21 +505,67 @@ show_tools_commands() {
|
|||||||
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}"
|
||||||
|
read -r mode
|
||||||
|
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" ;;
|
*) cmd="$user_input" ;;
|
||||||
esac
|
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..."
|
||||||
|
apt update -qq >/dev/null 2>&1
|
||||||
|
apt install -y $(echo "$cmd" | awk '{print $1}') >/dev/null 2>&1
|
||||||
|
msg_ok "$(translate "$cmd installed successfully")"
|
||||||
|
sleep 2
|
||||||
|
else
|
||||||
|
msg_info2 "$(translate 'Skipping installation.')"
|
||||||
|
read -r
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ===============================================================
|
# ===============================================================
|
||||||
# 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)
|
||||||
|
@ -52,7 +52,17 @@ 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>
|
||||||
|
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>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -49,7 +49,17 @@ 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>
|
||||||
|
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>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
BIN
web/public/help/help-info-menu.png
Normal file
BIN
web/public/help/help-info-menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 103 KiB |
Loading…
x
Reference in New Issue
Block a user