HansVanEijsden

Asterisk Script

Nov 29th, 2016
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Variabelen, geef hier de versie in
  4. ASTERISKV="14.2.0"
  5.  
  6. # Systeemvariabelen
  7. PATH=/usr/lib/ccache:$PATH
  8. DEB_CFLAGS_SET="-O3 -march=native -flto -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
  9. DEB_CXXFLAGS_SET="-O3 -march=native -flto -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
  10. DEB_FFLAGS_SET="-O3"
  11. DEB_LDFLAGS_SET="-Wl,-z,relro -flto"
  12.  
  13. # Downloaden, uitpakken en opschonen sources
  14. cd /usr/local/src
  15. curl -Lo asterisk.tar.gz http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-$ASTERISKV.tar.gz
  16. tar -zxf asterisk.tar.gz
  17. rm -f asterisk.tar.gz
  18. cd /usr/local/src/asterisk-$ASTERISKV
  19. make clean
  20.  
  21. # Downloaden MP3-addon
  22. contrib/scripts/get_mp3_source.sh
  23.  
  24. # Voorbereiden
  25. ./bootstrap.sh
  26. export PTLIB_CONFIG=/usr/lib/pkgconfig
  27.  
  28. # Configureren
  29. ./configure \
  30. CFLAGS="-DPJ_HAS_IPV6=1 -fPIC -O3 -march=native -flto" \
  31. CXXFLAGS="-fPIC -O3 -march=native -flto" \
  32. --with-pjproject-bundled \
  33. --with-mysqlclient=/usr/local/mysql
  34. make menuselect
  35.  
  36. # Installeren en opschonen
  37. make -j3 && sudo make install && sudo ldconfig
  38. rm -rf /usr/local/src/asterisk-$ASTERISKV
  39. sudo chown asterisk. /var/run/asterisk && sudo chown -R asterisk. /etc/asterisk && sudo chown -R asterisk. /var/{lib,log,spool}/asterisk && sudo chown -R asterisk. /usr/lib/asterisk && sudo rm -f /etc/init.d/asterisk
  40. sudo update-rc.d -f asterisk remove
  41.  
  42. # Vergeet niet de service te herstarten
  43. echo "Vergeet niet de service te herstarten: sudo systemctl restart freepbx"
Advertisement
Add Comment
Please, Sign In to add comment