#!/bin/sh #send a message echo "Install FusionPBX" #install dependencies apt-get install -y --force-yes vim git dbus haveged apt-get install -y --force-yes ghostscript libtiff5 libtiff-tools ###################### #adding FusionPBX repo ####################### echo ' installing fusionpbx jessie Stabe/Release repo ' cat > "/etc/apt/sources.list.d/fusionpbx.list" < '/etc/default/freeswitch' << DELIM CONFDIR="/etc/fusionpbx" # # Uncooment extra lines and make sure to add cut and paste them to the DAEMON_ARGS # Options to control locations of files: fs_conf="/etc/fusionpbx" fs_db="/var/lib/freeswitch/db" fs_imgs="/var/lib/fusionpbx/images" fs_log="/var/log/freeswitch" fs_recordings="/var/lib/fusionpbx/recordings" fs_run="/var/run/freeswitch" fs_scripts="/var/lib/fusionpbx/scripts" fs_storage="/var/lib/fusionpbx/storage" fs_usr=freeswitch fs_grp=\$fs_usr # #These are the optional arguments you can pass to freeswitch: (add options to fs_options line) # -nf -- no forking # -reincarnate -- restart the switch on an uncontrolled exit # -reincarnate-reexec -- run execv on a restart (helpful for upgrades) # -u [user] -- specify user to switch to # -g [group] -- specify group to switch to # -core -- dump cores # -rp -- enable high(realtime) priority settings # -lp -- enable low priority settings # -np -- enable normal priority settings # -vg -- run under valgrind # -nosql -- disable internal sql scoreboard # -heavy-timer -- Heavy Timer, possibly more accurate but at a cost # -nonat -- disable auto nat detection # -nonatmap -- disable auto nat port mapping # -nocal -- disable clock calibration # -nort -- disable clock clock_realtime # -stop -- stop freeswitch # -nc -- do not output to a console and background # -ncwait -- do not output to a console and background but wait until the system is ready before exiting (implies -nc) # -c -- output to a console and stay in the foreground fs_options="-nc -rp -reincarnate" # # Reads in the arguments into 1 line command DAEMON_ARGS="-u \$fs_usr -g \$fs_grp -conf \$fs_conf -db \$fs_db -images \$fs_images -log \$fs_log -scripts \$fs_scripts -run \$fs_run -storage \$fs_storage -recordings \$fs_recordings \$fs_options" DELIM ################################################################# #restartng services with thefusionpbx freeswitch fhs dir layoout ################################################################# echo " Restarting freeswitch for changes to take effect...." service freeswitch restart ######################## #set permissions on dir ######################## find "/var/lib/fusionpbx" -type d -exec chmod 775 {} + find "/var/lib/fusionpbx" -type f -exec chmod 664 {} +