Last active
April 2, 2022 20:45
-
-
Save alvaro-araya/dc727ec6ee230f531cacbc77560c4c3a to your computer and use it in GitHub Desktop.
FreePBX Commerial modules cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Created by Alvaro Araya O | |
## 2022-04-02 | |
## Script for disabling and removing FreePBX Commercial Modules | |
## Please review the script before running it. | |
## Script que deshabilita y remueve los módulos comerciales de FreePBX | |
## Por favor revisar el script antes de ejecutarlo. | |
## Loads a list of commercial modules | |
## Carga una lista de los módulos comerciales de FreePBX | |
premodules=$(fwconsole ma listonline | grep Commercial | awk '{print $2}'); | |
## Excludes the sysadmin module | |
## Excluye el módulo de sysadmin | |
protect=sysadmin | |
modules=("${premodules[@]/$protect}") | |
## Deactivates the modules | |
## Desactiva los módulos | |
for i in $modules | |
do | |
echo "Desactivando/Disabling: $i" | |
fwconsole ma disable $i | |
done | |
## Uninstalls the modules | |
## Desinstala los módulos | |
for i in $modules | |
do | |
echo "Desinstalando/Uninstalling: $i" | |
fwconsole ma uninstall $i | |
done | |
## Removes the modules | |
## Elimina los módulos | |
for i in $modules | |
do | |
echo "Removiendo/Deleting: $i" | |
fwconsole ma delete $i | |
done | |
## Shows the result with a list of online modules | |
## Muestra el resultado con la lista de módulos activos | |
fwconsole ma listonline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment