Reinstall CSF with backups and selective restoration options without hassle!
A powerful and safe shell script for fully reinstalling ConfigServer Security & Firewall (CSF) on cPanel/WHM servers. It includes automatic backups, interactive restoration options, and clean, controlled operations.
- β Automatically detects if CSF is installed
- πΎ It creates full backups of all important CSF configurations
- π§Ό Clean uninstallation of existing CSF installation
- π₯ Installs the latest CSF from ConfigServer
- π Interactive backup restore options
- π Safe and failsafe logic with log output and no re-tries
Run this in your terminal (as root):
wget https://raw.githubusercontent.com/thekugelblitz/CSFreinstaller/main/CSFreinstaller_v2.sh -O CSFreinstaller.sh && chmod +x CSFreinstaller.sh && ./CSFreinstaller.sh- Check if CSF is installed
- If installed, backs up all config files into
/root/csfbackup-YYYY-MM-DD-HHMMSS - Uninstalls CSF completely and cleanly
- Installs the latest version from ConfigServer
- Lists available backup folders in
/root/ - Offers interactive restore options:
- Restore all components
- Restore selected components
- Skip restore
- Restarts CSF and LFD
- Logs everything to
/root/CSFreinstaller.log
csf.confcsf.allow,csf.deny,csf.ignore,csf.pignore,csf.rignorecsf.logfiles,csf.smtpauth,csf.syslogs,csf.suignore- UI-related files:
ui.allow, messenger templates, etc.
- Script Log:
/root/CSFreinstaller.log - CSF Install Output:
/root/CSF-install.log
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Maintained & Developed by Dhruval Joshi from HostingSpell
GitHub Profile: @thekugelblitz |
This was created by Dhruval Joshi to use at HostingSpell and optimised with the help of GPT4 later.
If you want to contribute, feel free to fork and submit a PR! π
Pull requests and contributions are welcome!