Skip to content

Instantly share code, notes, and snippets.

@worldadventurer
Last active August 2, 2021 20:32
Show Gist options
  • Save worldadventurer/ebdcb77978340ac0ccb77e0841e2a938 to your computer and use it in GitHub Desktop.
Save worldadventurer/ebdcb77978340ac0ccb77e0841e2a938 to your computer and use it in GitHub Desktop.
FreePBX v14 Post-Install Script for Optimizing server
# This optimizes a fresh installed FreePBX 13 x64 Distro. Not tested on other versions.
echo NOTE - BE SURE THIS IS A CORRECT SERVER BEFORE RUNNING THIS
echo NOTE: This optimizes a fresh installed FreePBX 14 x64 Distro. Not tested on other versions.
echo This will optimize your server - only run this if you wont have hard phones.
echo Run this only for a virtual machine
read -rsp $'Press any key to continue OR CTRL-c to QUIT ...\n' -n1 key
#Install updates & other needed packages:
echo INSTALLING OS UPDATES-
yum update -y && yum upgrade -y
echo INSTALLING ADDITIONAL PACKAGES-
yum install -y git automake axel gettext perl-CPAN lrzsz help2man
# Install other useful stuff from EPEL repository:
axel -n 8 https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/i/iperf-2.0.11-1.el7.x86_64.rpm
rpm -Uvh iperf-2.0.11-1.el7.x86_64.rpm
#axel -n 8 https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/s/sqlite2-2.8.17-17.el7.x86_64.rpm
#rpm -Uvh sqlite2-2.8.17-17.el7.x86_64.rpm
# Get latest version of flite Text to Speech engine
#rpm -e flite-devel-1.3-14.el6.x86_64
#axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/flite-1.3-24.el6.x86_64.rpm
#rpm -Uvh flite-1.3-24.el6.x86_64.rpm
#axel -n 8 https://dl.fedoraproject.org/pub/epel/6/x86_64/flite-devel-1.3-24.el6.x86_64.rpm
#rpm -Uvh flite-devel-1.3-24.el6.x86_64.rpm
# Install MTR
git clone --depth 1 https://github.com/traviscross/mtr.git
cd mtr
./bootstrap.sh && ./configure && make
make install
# Install Do The Right Extraction
cd
wget https://brettcsmith.org/2007/dtrx/dtrx-7.1.tar.gz
tar -xvf dtrx-7.1.tar.gz && cd dtrx-7.1 && python setup.py install
# Install Midnight Commander
cd
axel -n 8 http://mirror.centos.org/centos/7/os/x86_64/Packages/mc-4.8.7-11.el7.x86_64.rpm
rpm -Uvh mc-4.8.7-11.el7.x86_64.rpm
#Uninstall commercial and hardphone related modules & packages
fwconsole ma downloadinstall customcontexts
fwconsole ma downloadinstall extensionsettings
fwconsole ma downloadinstall motif
fwconsole ma uninstall areminder
fwconsole ma uninstall broadcast
fwconsole ma uninstall callerid
fwconsole ma uninstall calllimit
fwconsole ma uninstall conferencespro
fwconsole ma uninstall cos
fwconsole ma uninstall cxpanel
fwconsole ma uninstall dahdiconfig
fwconsole ma uninstall digium_phones
fwconsole ma uninstall digiumaddoninstaller
fwconsole ma uninstall extensionroutes
fwconsole ma uninstall faxpro
fwconsole ma uninstall fax
fwconsole ma uninstall freepbx_ha
fwconsole ma uninstall iaxsettings
fwconsole ma uninstall pagingpro
fwconsole ma uninstall parkpro
fwconsole ma uninstall pinsetspro
fwconsole ma uninstall queuestats
fwconsole ma uninstall recording_report
fwconsole ma uninstall restapps
fwconsole ma uninstall sangomacrm
fwconsole ma uninstall sipstation
fwconsole ma uninstall sms
fwconsole ma uninstall vmnotify
fwconsole ma uninstall voicemail_report
fwconsole ma uninstall vqplus
fwconsole ma uninstall webcallback
fwconsole ma uninstall zulu
fwconsole ma uninstall xmpp
fwconsole ma uninstall endpoint
# Add extended and unsupported repos to search. Yes, weird how need to run three times like this.
fwconsole ma showupgrades
fwconsole ma showupgrades -R extended
fwconsole ma showupgrades -R unsupported
# Upgrade all FreePBX packages
fwconsole ma upgradeall
#
#######################################
# Optimize OS now...
#
# Reduce Apache threads:
#cd /etc/httpd/conf
#wget https://raw.githubusercontent.com/FreePBXHosting/freepbx-scripts/master/optimizeapache/optimizeapache.sh
#bash optimizeapache.sh
# Only needed for digium hardware boards:
service dahdi stop
chkconfig dahdi off
# Remove prosody xmpp server from running (already uninstalled from FreePBX Modules):
service prosody stop
chkconfig prosody off
# Remove audit:
rpm -e audit amtu autofs
# Remove support for plug and play devices
service haldaemon stop
chkconfig --levels 2345 haldaemon off
service messagebus stop
chkconfig messagebus off
# Remove acpid for the physical power button
service acpid stop
chkconfig acpid off
chkconfig --levels 2345 acpid off
rpm -e acpid
# Remove avahi
# ERR: avahi is needed by (installed) sangoma-pbx-1807-1.sng7.noarch
#rpm -e avahi
# Remove - only needed for Software RAID:
service stop mdmonitor
chkconfig mdmonitor off
# Now please reboot
echo Done Opimitizing your system.
echo PLEASE Reboot your server now
echo type reboot and hit enter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment