2025-01-29 21:42:22 +01:00
#!/bin/bash
# ==========================================================
2025-09-10 18:47:55 +02:00
# ProxMenux - A menu-driven script for Proxmox VE management
2025-01-29 21:42:22 +01:00
# ==========================================================
# Author : MacRimi
# Copyright : (c) 2024 MacRimi
2025-11-14 02:20:07 +00:00
# Contributors : cod378
2026-01-19 17:15:00 +01:00
# License : (GPL-3.0) (https://github.com/MacRimi/ProxMenux/blob/main/LICENSE)
2025-07-05 17:26:31 +02:00
# Version : 1.1
# Last Updated: 04/07/2025
2025-01-29 21:42:22 +01:00
# ==========================================================
# Configuration ============================================
2025-11-03 00:22:59 +00:00
LOCAL_SCRIPTS = "/usr/local/share/proxmenux/scripts"
2025-01-29 21:42:22 +01:00
BASE_DIR = "/usr/local/share/proxmenux"
2025-07-05 17:26:31 +02:00
CONFIG_FILE = " $BASE_DIR /config.json "
CACHE_FILE = " $BASE_DIR /cache.json "
2025-02-02 09:50:27 +01:00
UTILS_FILE = " $BASE_DIR /utils.sh "
2025-07-05 17:26:31 +02:00
LOCAL_VERSION_FILE = " $BASE_DIR /version.txt "
INSTALL_DIR = "/usr/local/bin"
MENU_SCRIPT = "menu"
2025-01-29 21:42:22 +01:00
VENV_PATH = "/opt/googletrans-env"
2025-11-14 01:49:39 +00:00
2025-10-31 22:44:59 +01:00
MONITOR_SERVICE = "proxmenux-monitor.service"
2025-11-14 01:49:39 +00:00
MONITOR_UNIT_FILE = " /etc/systemd/system/ ${ MONITOR_SERVICE } "
2025-11-14 17:44:19 +01:00
MONITOR_CONFIG_DIR = "/root/.config/proxmenux-monitor"
2025-01-29 21:42:22 +01:00
2025-02-02 09:50:27 +01:00
if [ [ -f " $UTILS_FILE " ] ] ; then
source " $UTILS_FILE "
2025-01-29 21:42:22 +01:00
fi
2025-07-05 17:26:31 +02:00
2025-02-02 09:50:27 +01:00
load_language
initialize_cache
2025-07-05 17:26:31 +02:00
2025-01-29 21:42:22 +01:00
# ==========================================================
2025-11-14 01:49:39 +00:00
uninstall_proxmenux_monitor( ) {
# 1. Stop service if it is running
2025-11-14 02:30:19 +00:00
if systemctl is-active --quiet " ${ MONITOR_SERVICE } " ; then
2025-11-14 01:49:39 +00:00
echo " - Stoping service..."
2025-11-14 02:37:43 +00:00
systemctl stop " ${ MONITOR_SERVICE } " > /dev/null 2>& 1
2025-11-14 01:49:39 +00:00
else
echo " - Service is not running (ok)"
fi
# 2. Disable service if enabled
2025-11-14 02:30:19 +00:00
if systemctl is-enabled --quiet " ${ MONITOR_SERVICE } " ; then
2025-11-14 01:49:39 +00:00
echo " - Disabling service..."
2025-11-14 02:37:43 +00:00
systemctl disable " ${ MONITOR_SERVICE } " > /dev/null 2>& 1
2025-11-14 01:49:39 +00:00
else
echo " - Service is not enabled (ok)"
fi
# 3. Remove unit file
if [ -f " ${ MONITOR_UNIT_FILE } " ] ; then
echo " - Removing unit file ${ MONITOR_UNIT_FILE } ... "
rm -f " ${ MONITOR_UNIT_FILE } "
else
echo " - Unit file ${ MONITOR_UNIT_FILE } does not exist (ok) "
fi
2025-11-14 17:44:19 +01:00
# 4. Remove config directory (~/.config/proxmenux-monitor)
if [ -d " ${ MONITOR_CONFIG_DIR } " ] ; then
echo " - Removing config dir ${ MONITOR_CONFIG_DIR } ... "
rm -rf " ${ MONITOR_CONFIG_DIR } "
else
echo " - Config dir ${ MONITOR_CONFIG_DIR } does not exist (ok) "
fi
# 5. Reload systemd
2025-11-14 01:49:39 +00:00
echo " - Recargando systemd..."
2025-11-14 02:37:43 +00:00
systemctl daemon-reload > /dev/null 2>& 1
systemctl reset-failed > /dev/null 2>& 1 || true
2025-11-14 01:49:39 +00:00
2025-11-14 02:30:19 +00:00
echo " ==> Service ${ MONITOR_SERVICE } uninstalled. "
2025-11-14 17:44:19 +01:00
2025-11-14 01:49:39 +00:00
}
2025-07-05 17:26:31 +02:00
detect_installation_type( ) {
local has_venv = false
local has_language = false
2025-10-31 22:44:59 +01:00
# Check if virtual environment exists
2025-07-05 17:26:31 +02:00
if [ -d " $VENV_PATH " ] && [ -f " $VENV_PATH /bin/activate " ] ; then
has_venv = true
fi
2025-10-31 22:44:59 +01:00
# Check if language is configured
2025-07-05 17:26:31 +02:00
if [ -f " $CONFIG_FILE " ] ; then
local current_language = $( jq -r '.language // empty' " $CONFIG_FILE " 2>/dev/null)
if [ [ -n " $current_language " && " $current_language " != "null" && " $current_language " != "empty" ] ] ; then
has_language = true
fi
fi
if [ " $has_venv " = true ] && [ " $has_language " = true ] ; then
echo "translation"
else
echo "normal"
fi
}
2025-10-31 22:44:59 +01:00
check_monitor_status( ) {
if systemctl list-unit-files | grep -q " $MONITOR_SERVICE " ; then
if systemctl is-active --quiet " $MONITOR_SERVICE " ; then
echo "active"
else
echo "inactive"
fi
else
echo "not_installed"
fi
}
2026-04-18 01:13:13 +02:00
is_beta_program_active( ) {
[ [ -f " $CONFIG_FILE " ] ] || return 1
local flag
flag = $( jq -r '.beta_program.status // empty' " $CONFIG_FILE " 2>/dev/null)
[ [ " $flag " = = "active" ] ]
}
deactivate_beta_program( ) {
if dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Deactivate Beta Program" ) " \
--yesno " \n $( translate "You will stop receiving beta update prompts. Stable updates continue normally.\n\nTo rejoin the beta program later, run the beta installer again.\n\nDeactivate now?" ) " 14 64; then
local tmp
tmp = $( mktemp)
if jq '.beta_program.status = "inactive"' " $CONFIG_FILE " > " $tmp " 2>/dev/null; then
mv " $tmp " " $CONFIG_FILE "
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Beta Program Deactivated" ) " \
--msgbox " \n\n $( translate "Beta program deactivated. You will now receive stable updates only." ) " 10 60
else
rm -f " $tmp "
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Error" ) " \
--msgbox " \n\n $( translate "Could not update config file." ) " 10 50
fi
fi
}
2025-10-31 22:44:59 +01:00
toggle_monitor_service( ) {
local status = $( check_monitor_status)
if [ " $status " = "not_installed" ] ; then
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "ProxMenux Monitor" ) " \
--msgbox " \n\n $( translate "ProxMenux Monitor is not installed." ) " 10 50
return
fi
if [ " $status " = "active" ] ; then
if dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Deactivate Monitor" ) " \
--yesno " \n $( translate "Do you want to deactivate ProxMenux Monitor?" ) " 8 60; then
systemctl stop " $MONITOR_SERVICE " 2>/dev/null
systemctl disable " $MONITOR_SERVICE " 2>/dev/null
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Monitor Deactivated" ) " \
--msgbox " \n\n $( translate "ProxMenux Monitor has been deactivated." ) " 10 50
fi
else
if dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Activate Monitor" ) " \
--yesno " \n $( translate "Do you want to activate ProxMenux Monitor?" ) " 8 60; then
systemctl enable " $MONITOR_SERVICE " 2>/dev/null
systemctl start " $MONITOR_SERVICE " 2>/dev/null
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Monitor Activated" ) " \
--msgbox " \n\n $( translate "ProxMenux Monitor has been activated." ) " 10 50
fi
fi
}
show_monitor_status( ) {
clear
show_proxmenux_logo
msg_title " $( translate "ProxMenux Monitor Service Verification" ) "
echo ""
local status = $( check_monitor_status)
if [ " $status " = "not_installed" ] ; then
msg_warn " $( translate "ProxMenux Monitor is not installed" ) "
echo ""
msg_info2 " $( translate "To install the monitor, reinstall ProxMenux with the latest version" ) "
else
msg_info2 " $( translate "Service Status" ) : $MONITOR_SERVICE "
echo ""
if [ " $status " = "active" ] ; then
msg_ok " $( translate "Service is active and running" ) "
local server_ip = $( hostname -I | awk '{print $1}' )
if [ -n " $server_ip " ] ; then
echo -e " ${ TAB } ${ GN } 🌐 $( translate "Monitor URL" ) ${ CL } : ${ BL } http:// ${ server_ip } :8008 ${ CL } "
fi
else
msg_warn " $( translate "Service is inactive" ) "
fi
echo ""
msg_info2 " $( translate "Detailed service information" ) : "
echo ""
systemctl status " $MONITOR_SERVICE " --no-pager -l
fi
echo ""
msg_success " $( translate "Press Enter to continue..." ) "
read -r
}
2025-07-05 17:26:31 +02:00
# ==========================================================
2025-01-29 21:31:10 +01:00
show_config_menu( ) {
2025-07-05 17:26:31 +02:00
local install_type
install_type = $( detect_installation_type)
2025-02-25 18:17:24 +01:00
2025-01-29 21:31:10 +01:00
while true; do
2025-07-05 17:26:31 +02:00
local menu_options = ( )
local option_actions = ( )
2025-10-31 22:44:59 +01:00
local monitor_status = $( check_monitor_status)
local option_num = 1
if [ " $monitor_status " != "not_installed" ] ; then
if [ " $monitor_status " = "active" ] ; then
menu_options += ( " $option_num " " $( translate "Deactivate ProxMenux Monitor" ) " )
option_actions[ $option_num ] = "toggle_monitor"
else
menu_options += ( " $option_num " " $( translate "Activate ProxMenux Monitor" ) " )
option_actions[ $option_num ] = "toggle_monitor"
fi
( ( option_num++) )
menu_options += ( " $option_num " " $( translate "Show Monitor Service Status" ) " )
option_actions[ $option_num ] = "show_monitor_status"
( ( option_num++) )
fi
2026-04-18 01:13:13 +02:00
if is_beta_program_active; then
menu_options += ( " $option_num " " $( translate "Deactivate Beta Program" ) " )
option_actions[ $option_num ] = "deactivate_beta"
( ( option_num++) )
fi
2025-10-31 22:44:59 +01:00
# Build menu based on installation type
2025-07-05 17:26:31 +02:00
if [ " $install_type " = "translation" ] ; then
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " " $( translate "Change Language" ) " )
option_actions[ $option_num ] = "change_language"
( ( option_num++) )
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " " $( translate "Show Version Information" ) " )
option_actions[ $option_num ] = "show_version_info"
( ( option_num++) )
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " " $( translate "Uninstall ProxMenux" ) " )
option_actions[ $option_num ] = "uninstall_proxmenu"
( ( option_num++) )
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " " $( translate "Return to Main Menu" ) " )
option_actions[ $option_num ] = "return_main"
2025-07-05 17:26:31 +02:00
else
2025-10-31 22:44:59 +01:00
# Normal version (English only)
menu_options += ( " $option_num " "Show Version Information" )
option_actions[ $option_num ] = "show_version_info"
( ( option_num++) )
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " "Uninstall ProxMenux" )
option_actions[ $option_num ] = "uninstall_proxmenu"
( ( option_num++) )
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
menu_options += ( " $option_num " "Return to Main Menu" )
option_actions[ $option_num ] = "return_main"
2025-07-05 17:26:31 +02:00
fi
2025-10-31 22:44:59 +01:00
# Show menu
2025-07-05 17:26:31 +02:00
OPTION = $( dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Configuration Menu" ) " \
2025-07-05 17:31:18 +02:00
--menu " $( translate "Select an option:" ) " 20 70 10 \
2025-07-05 17:26:31 +02:00
" ${ menu_options [@] } " 3>& 1 1>& 2 2>& 3)
2025-10-31 22:44:59 +01:00
# Execute selected action
2025-07-05 17:26:31 +02:00
case " ${ option_actions [ $OPTION ] } " in
2025-10-31 22:44:59 +01:00
"toggle_monitor" )
toggle_monitor_service
; ;
"show_monitor_status" )
show_monitor_status
; ;
2026-04-18 01:13:13 +02:00
"deactivate_beta" )
deactivate_beta_program
; ;
2025-07-05 17:26:31 +02:00
"change_language" )
2025-01-29 21:31:10 +01:00
change_language
; ;
2025-07-05 17:26:31 +02:00
"show_version_info" )
2025-01-29 21:31:10 +01:00
show_version_info
; ;
2025-07-05 17:26:31 +02:00
"uninstall_proxmenu" )
2025-01-29 21:31:10 +01:00
uninstall_proxmenu
; ;
2025-07-05 17:26:31 +02:00
"return_main" | "" )
2025-11-03 00:22:59 +00:00
exec bash " $LOCAL_SCRIPTS /menus/main_menu.sh "
2025-07-05 17:26:31 +02:00
; ;
2025-01-29 21:31:10 +01:00
esac
done
}
2025-02-06 17:34:39 +01:00
# ==========================================================
2025-01-29 21:31:10 +01:00
change_language( ) {
2025-07-05 17:26:31 +02:00
local new_language
new_language = $( dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Change Language" ) " \
--menu " $( translate "Select a new language for the menu:" ) " 20 60 6 \
"en" " $( translate "English" ) " \
"es" " $( translate "Spanish" ) " \
"fr" " $( translate "French" ) " \
"de" " $( translate "German" ) " \
"it" " $( translate "Italian" ) " \
"pt" " $( translate "Portuguese" ) " 3>& 1 1>& 2 2>& 3)
if [ -z " $new_language " ] ; then
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Language Change" ) " \
--msgbox " \n\n $( translate "No language selected." ) " 10 50
2025-01-29 21:31:10 +01:00
return
fi
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
# Update language in config file
2025-02-05 20:57:02 +01:00
if [ -f " $CONFIG_FILE " ] ; then
tmp = $( mktemp)
2025-07-05 17:26:31 +02:00
jq --arg lang " $new_language " '.language = $lang' " $CONFIG_FILE " > " $tmp " && mv " $tmp " " $CONFIG_FILE "
2025-02-05 20:57:02 +01:00
else
2025-07-05 17:26:31 +02:00
echo " {\"language\": \" $new_language \"} " > " $CONFIG_FILE "
2025-02-05 20:57:02 +01:00
fi
2025-07-05 17:26:31 +02:00
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "Language Change" ) " \
--msgbox " \n\n $( translate "Language changed to" ) $new_language " 10 50
2025-10-31 22:44:59 +01:00
# Reload menu with new language
2025-11-03 00:22:59 +00:00
exec bash " $LOCAL_SCRIPTS /menus/config_menu.sh "
2025-01-29 21:31:10 +01:00
}
2025-02-06 17:34:39 +01:00
# ==========================================================
2025-01-29 21:31:10 +01:00
show_version_info( ) {
2025-07-05 17:26:31 +02:00
local version info_message install_type
install_type = $( detect_installation_type)
if [ -f " $LOCAL_VERSION_FILE " ] ; then
version = $( <" $LOCAL_VERSION_FILE " )
else
version = "Unknown"
fi
2025-05-05 11:33:47 +02:00
info_message += " $( translate "Current ProxMenux version:" ) $version \n\n "
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
# Show installation type
2025-07-05 17:26:31 +02:00
info_message += " $( translate "Installation type:" ) \n "
if [ " $install_type " = "translation" ] ; then
info_message += " ✓ $( translate "Translation Version (Multi-language support)" ) \n "
else
info_message += " ✓ $( translate "Normal Version (English only - Lightweight)" ) \n "
fi
info_message += "\n"
info_message += " $( translate "Installed components:" ) \n "
2025-02-06 17:34:39 +01:00
if [ -f " $CONFIG_FILE " ] ; then
while IFS = ': ' read -r component value; do
2025-05-05 11:33:47 +02:00
[ " $component " = "language" ] && continue
2025-02-06 17:34:39 +01:00
local status
if echo " $value " | jq -e '.status' >/dev/null 2>& 1; then
status = $( echo " $value " | jq -r '.status' )
else
status = " $value "
fi
local translated_status = $( translate " $status " )
case " $status " in
2025-11-14 22:17:11 +01:00
"installed" | "already_installed" | "created" | "already_exists" | "upgraded" | "updated" )
2025-02-06 17:34:39 +01:00
info_message += " ✓ $component : $translated_status \n "
; ;
*)
info_message += " ✗ $component : $translated_status \n "
; ;
esac
done < <( jq -r 'to_entries[] | "\(.key): \(.value)"' " $CONFIG_FILE " )
else
info_message += " $( translate "No installation information available." ) \n "
fi
2025-07-05 17:26:31 +02:00
2025-09-10 18:47:55 +02:00
info_message += " \n $( translate "ProxMenux files:" ) \n "
2025-02-06 18:40:26 +01:00
[ -f " $INSTALL_DIR / $MENU_SCRIPT " ] && info_message += " ✓ $MENU_SCRIPT → $INSTALL_DIR / $MENU_SCRIPT \n " || info_message += " ✗ $MENU_SCRIPT \n "
[ -f " $UTILS_FILE " ] && info_message += " ✓ utils.sh → $UTILS_FILE \n " || info_message += "✗ utils.sh\n"
[ -f " $CONFIG_FILE " ] && info_message += " ✓ config.json → $CONFIG_FILE \n " || info_message += "✗ config.json\n"
[ -f " $LOCAL_VERSION_FILE " ] && info_message += " ✓ version.txt → $LOCAL_VERSION_FILE \n " || info_message += "✗ version.txt\n"
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
# Show translation-specific files
2025-07-05 17:26:31 +02:00
if [ " $install_type " = "translation" ] ; then
[ -f " $CACHE_FILE " ] && info_message += " ✓ cache.json → $CACHE_FILE \n " || info_message += "✗ cache.json\n"
info_message += " \n $( translate "Virtual Environment:" ) \n "
if [ -d " $VENV_PATH " ] && [ -f " $VENV_PATH /bin/activate " ] ; then
info_message += " ✓ $( translate "Installed" ) → $VENV_PATH \n "
[ -f " $VENV_PATH /bin/pip " ] && info_message += " ✓ pip: $( translate "Installed" ) → $VENV_PATH /bin/pip\n " || info_message += " ✗ pip: $( translate "Not installed" ) \n "
else
info_message += " ✗ $( translate "Virtual Environment" ) : $( translate "Not installed" ) \n "
info_message += " ✗ pip: $( translate "Not installed" ) \n "
fi
current_language = $( jq -r '.language // "en"' " $CONFIG_FILE " )
info_message += " \n $( translate "Current language:" ) \n $current_language \n "
2025-02-06 17:34:39 +01:00
else
2025-07-05 17:26:31 +02:00
info_message += " \n $( translate "Language:" ) \nEnglish (Fixed)\n "
2025-02-06 17:34:39 +01:00
fi
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
# Display information in a scrollable text box
2025-07-05 17:26:31 +02:00
tmpfile = $( mktemp)
echo -e " $info_message " > " $tmpfile "
dialog --clear --backtitle "ProxMenux Configuration" \
--title " $( translate "ProxMenux Information" ) " \
--textbox " $tmpfile " 25 80
rm -f " $tmpfile "
2025-01-29 21:31:10 +01:00
}
2025-02-06 17:34:39 +01:00
# ==========================================================
uninstall_proxmenu( ) {
2025-07-05 17:26:31 +02:00
local install_type
install_type = $( detect_installation_type)
if ! dialog --clear --backtitle "ProxMenux Configuration" \
2025-09-10 19:06:04 +02:00
--title "Uninstall ProxMenux" \
--yesno " \n $( translate "Are you sure you want to uninstall ProxMenux?" ) " 8 60; then
2025-02-06 17:34:39 +01:00
return
fi
2025-07-05 17:26:31 +02:00
local deps_to_remove = ""
2025-10-31 22:44:59 +01:00
# Show different dependency options based on installation type
2025-07-05 17:26:31 +02:00
if [ " $install_type " = "translation" ] ; then
deps_to_remove = $( dialog --clear --backtitle "ProxMenux Configuration" \
--title "Remove Dependencies" \
--checklist "Select dependencies to remove:" 15 60 4 \
"python3-venv" "Python virtual environment" OFF \
"python3-pip" "Python package installer" OFF \
"python3" "Python interpreter" OFF \
"jq" "JSON processor" OFF \
3>& 1 1>& 2 2>& 3)
else
deps_to_remove = $( dialog --clear --backtitle "ProxMenux Configuration" \
--title "Remove Dependencies" \
--checklist "Select dependencies to remove:" 12 60 2 \
"dialog" "Interactive dialog boxes" OFF \
"jq" "JSON processor" OFF \
3>& 1 1>& 2 2>& 3)
2025-02-06 17:34:39 +01:00
fi
2025-07-05 17:26:31 +02:00
2025-10-31 22:44:59 +01:00
# Perform uninstallation with progress bar
2025-07-05 17:26:31 +02:00
(
echo "10" ; echo "Removing ProxMenu files..."
sleep 1
2025-05-08 09:22:00 +02:00
2025-10-31 22:44:59 +01:00
# Remove googletrans and virtual environment if exists
2025-07-05 17:26:31 +02:00
if [ -f " $VENV_PATH /bin/activate " ] ; then
echo "30" ; echo "Removing googletrans and virtual environment..."
source " $VENV_PATH /bin/activate "
pip uninstall -y googletrans >/dev/null 2>& 1
deactivate
rm -rf " $VENV_PATH "
fi
echo "50" ; echo "Removing ProxMenu files..."
rm -f " $INSTALL_DIR / $MENU_SCRIPT "
rm -rf " $BASE_DIR "
2025-10-31 22:44:59 +01:00
# Remove selected dependencies
2025-07-05 17:26:31 +02:00
if [ -n " $deps_to_remove " ] ; then
echo "70" ; echo "Removing selected dependencies..."
read -r -a DEPS_ARRAY <<< " $( echo " $deps_to_remove " | tr -d '"' ) "
for dep in " ${ DEPS_ARRAY [@] } " ; do
apt-mark auto " $dep " >/dev/null 2>& 1
apt-get -y --purge autoremove " $dep " >/dev/null 2>& 1
done
apt-get autoremove -y --purge >/dev/null 2>& 1
fi
2025-11-14 01:49:39 +00:00
echo "80" ; echo "Removing ProxMenux Monitor..."
uninstall_proxmenux_monitor
2025-07-05 17:26:31 +02:00
echo "90" ; echo "Restoring system files..."
2025-10-31 22:44:59 +01:00
# Restore .bashrc and motd
2025-07-05 17:26:31 +02:00
[ -f /root/.bashrc.bak ] && mv /root/.bashrc.bak /root/.bashrc
if [ -f /etc/motd.bak ] ; then
mv /etc/motd.bak /etc/motd
else
sed -i '/This system is optimised by: ProxMenux/d' /etc/motd
fi
echo "100" ; echo "Uninstallation complete!"
sleep 1
) | dialog --clear --backtitle "ProxMenux Configuration" \
--title "Uninstalling ProxMenux" \
--gauge "Starting uninstallation..." 10 60 0
2025-05-08 09:22:00 +02:00
2025-10-31 22:44:59 +01:00
# Show completion message
2025-07-05 17:26:31 +02:00
local final_message = "ProxMenux has been uninstalled successfully.\n\n"
if [ -n " $deps_to_remove " ] ; then
final_message += " The following dependencies were removed:\n $deps_to_remove \n\n "
2025-02-06 17:34:39 +01:00
fi
2025-07-05 17:26:31 +02:00
final_message += "Thank you for using ProxMenux!"
2025-05-08 09:22:00 +02:00
2025-07-05 17:26:31 +02:00
dialog --clear --backtitle "ProxMenux Configuration" \
--title "Uninstallation Complete" \
--msgbox " $final_message " 12 60
clear
2025-02-06 17:34:39 +01:00
exit 0
}
2025-07-05 17:26:31 +02:00
# ==========================================================
# Main execution
2025-10-31 22:44:59 +01:00
show_config_menu