4 KiB
FreePBX 17 Uninstaller for Proxmox 🚀
Did you accidentally install FreePBX 17 using the official installation script from https://github.com/FreePBX/sng_freepbx_debian_install on your Proxmox server, just like I did? 🤦♂️ No worries, I've got you covered with this uninstall script!
This script aims to completely remove FreePBX 17 and its components, with special care taken for Proxmox installations. While I can't guarantee 100% safety (always be cautious!), in my case, it successfully removed FreePBX dependencies without breaking my Proxmox setup. 🙏 Disclaimer & Warning 🚨
USE AT YOUR OWN RISK! This script performs powerful actions that modify your system. While it's designed to be Proxmox-friendly, there's always a risk of unintended consequences. ALWAYS BACK UP YOUR SYSTEM BEFORE RUNNING THIS SCRIPT! The script does create an automatic backup, but having your own external backup is crucial. How to Use 🛠️
wget https://github.com/kraken537/Uninstal-FreePBX-from-proxmox-script/raw/main/freepbx_uninstall.sh
Give it execution permissions:
chmod +x freepbx_uninstall.sh
Run the script as root:
sudo ./freepbx_uninstall.sh
The script will guide you through the process, ask for confirmations, and provide warnings, especially if it detects Proxmox. Pay close attention to its output! 👀
What the Script Does (and tries not to do to Proxmox) ✨
Checks for Root: Ensures you're running it as root. Initializes Logging: Creates a detailed log file at /var/log/freepbx-uninstall.log for troubleshooting. Proxmox Detection & Warning: It will explicitly warn you if Proxmox is detected and ask for confirmation to proceed, highlighting shared packages. Automatic Backup: Creates a comprehensive backup of important FreePBX and system configuration files in /var/backups/freepbx-uninstall-DATE-TIME. Stops Services: Gracefully stops FreePBX, Asterisk, and other related services like Apache2, MariaDB, Fail2ban, etc. Smart Package Removal: Removes core FreePBX and Asterisk packages. It's extra careful with packages potentially used by Proxmox (like Apache2, MariaDB, Fail2ban, Node.js, Postfix) and will ask for your confirmation before touching them. The script will try to keep them if they have dependencies. User & Group Cleanup: Removes the asterisk user and group. Directory & File Purge: Deletes FreePBX-specific directories and files (/var/www/html, /etc/asterisk, /var/lib/asterisk, etc.). Configuration Cleanup: Attempts to restore openssl.cnf and gai.conf to their original states if FreePBX modified them, with warnings regarding Proxmox SSL. Cleans up FreePBX entries from .screenrc and vimrc.local. Removes FreePBX-specific APT configuration files. Repository Removal: Gets rid of FreePBX APT repositories and GPG keys. Database Handling: Gives you options to: Keep all databases (recommended for Proxmox). Remove only FreePBX-related databases (if they exist). DANGER! Remove ALL databases. Final System Cleanup: Performs apt autoremove, apt autoclean, and updates the package list. Post-Uninstall Info: Provides essential information like log file location, backup directory, and a strong recommendation to reboot.
After Running 🔄
REBOOT YOUR SYSTEM! sudo reboot Check your Proxmox web interface (https://your-ip:8006) to ensure everything is working as expected. If you encounter issues with Proxmox, try restarting its services: systemctl restart pveproxy pvedaemon. Your log file (/var/log/freepbx-uninstall.log) and backup directory (/var/backups/freepbx-uninstall-DATE-TIME) are your best friends if something goes wrong.
Hope this helps you clean up your server! 👍
📜 License
This project is licensed under the MIT License - see the LICENSE file for details (though you'll need to create this file if you want to include it).
Crafted with ❤️ by Kuzyn