Update uninstall-tools.sh

This commit is contained in:
MacRimi 2025-05-02 21:24:28 +02:00
parent b9aa6d57d5
commit ad869cc076

View File

@ -14,8 +14,9 @@
# installed through ProxMenux on Proxmox Virtual Environment (VE). # installed through ProxMenux on Proxmox Virtual Environment (VE).
# ========================================================== # ==========================================================
# Configuration # Configuration ============================================
REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main" REPO_URL="https://raw.githubusercontent.com/MacRimi/ProxMenux/main"
RETURN_SCRIPT="$REPO_URL/scripts/menus/menu_post_install.sh"
BASE_DIR="/usr/local/share/proxmenux" BASE_DIR="/usr/local/share/proxmenux"
UTILS_FILE="$BASE_DIR/utils.sh" UTILS_FILE="$BASE_DIR/utils.sh"
VENV_PATH="/opt/googletrans-env" VENV_PATH="/opt/googletrans-env"
@ -23,7 +24,6 @@ VENV_PATH="/opt/googletrans-env"
if [[ -f "$UTILS_FILE" ]]; then if [[ -f "$UTILS_FILE" ]]; then
source "$UTILS_FILE" source "$UTILS_FILE"
fi fi
load_language load_language
initialize_cache initialize_cache
# ========================================================== # ==========================================================
@ -52,26 +52,40 @@ uninstall_fastfetch() {
show_uninstall_menu() { show_uninstall_menu() {
local options=() local options=()
# Fastfetch
if command -v fastfetch &>/dev/null; then if command -v fastfetch &>/dev/null; then
options+=("1" "$(translate "Uninstall Fastfetch")") options+=("1" "$(translate "Uninstall Fastfetch")")
fi fi
if [ ${#options[@]} -eq 0 ]; then if [ ${#options[@]} -eq 0 ]; then
whiptail --title "ProxMenux" --msgbox "$(translate "No uninstallable tools detected.")" 10 60 whiptail --title "ProxMenux" --msgbox "$(translate "No uninstallable tools detected.")" 10 60
exec bash <(curl -s "$REPO_URL/scripts/menus/postinstall_menu.sh") return_to_menu
fi fi
local choice=$(whiptail --title "$(translate "Uninstall Tools")" \ local choice
--menu "$(translate "Select a tool to uninstall:")" 15 60 6 \ choice=$(whiptail --title "$(translate "Uninstall Tools")" \
"${options[@]}" 3>&1 1>&2 2>&3) --menu "$(translate "Select a tool to uninstall:")" 15 60 6 \
"${options[@]}" 3>&1 1>&2 2>&3)
case "$choice" in case "$choice" in
1) uninstall_fastfetch ;; 1) uninstall_fastfetch ;;
esac esac
return_to_menu
exec bash <(curl -s "$REPO_URL/scripts/menus/postinstall_menu.sh")
} }
return_to_menu() {
# Descargar temporalmente el script
TEMP_SCRIPT=$(mktemp)
if curl --fail -s -o "$TEMP_SCRIPT" "$RETURN_SCRIPT"; then
bash "$TEMP_SCRIPT"
rm -f "$TEMP_SCRIPT"
else
msg_error "$(translate "Error: Could not return to menu. URL returned 404.")"
msg_info2 "$(translate "Please check the menu URL in the script.")"
read -r
exit 1
fi
}
show_uninstall_menu show_uninstall_menu