Guest User

Untitled

a guest
May 6th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. while true; do
  2. read -p "If you already have compiled FreeSWITCH you will need to manually edit the configure file to set enable_core_odbc_support=yes, are you sure you want to continue? (y/n)" yn
  3. case $yn in
  4. [Yy]* ) break;;
  5. [Nn]* ) exit;;
  6. * ) echo "Please answer yes to continue to installing ODBC and compiling FreeSWITCH, answer no to abort this process.";;
  7. esac
  8. done
  9.  
  10. yum -y install unixODBC-devel mysql-connector-odbc
  11.  
  12. odbcinst -j
  13.  
  14. ln -s /usr/lib64/libmyodbc5.so /usr/lib/libmyodbc5.so
  15. ln -s /usr/lib64/libodbcmyS.so /usr/lib/libodbcmyS.so
  16.  
  17. rm /etc/odbc.ini
  18. rm /etc/odbcinst.ini
  19.  
  20. fscompilepath=/usr/local/src/freeswitch
  21. odbcinst=/usr/local/etc/odbcinst.ini
  22.  
  23. echo "[MySQL]" > $odbcinst
  24. echo "Description = ODBC for MySQL" >> $odbcinst
  25. echo "Driver = /usr/lib/libmyodbc5.so" >> $odbcinst
  26. echo "Setup = /usr/lib/libodbcmyS.so" >> $odbcinst
  27. echo "Driver64 = /usr/lib64/libmyodbc5.so" >> $odbcinst
  28. echo "Setup64 = /usr/lib64/libodbcmyS.so" >> $odbcinst
  29. echo "FileUsage = 1" >> $odbcinst
  30.  
  31. odbcini=/usr/local/etc/odbc.ini
  32.  
  33. echo "[freeswitch]" > $odbcini
  34. echo "Driver = MySQL" >> $odbcini
  35. echo "SERVER = " >> $odbcini
  36. echo "PORT = 3306" >> $odbcini
  37. echo "DATABASE = freeswitch" >> $odbcini
  38. echo "OPTION = 67108864" >> $odbcini
  39. echo "USERNAME = " >> $odbcini
  40. echo "PASSWORD = " >> $odbcini
  41.  
  42. ln -s /usr/local/etc/odbc.ini /etc/odbc.ini
  43. ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
  44. ln -s /usr/local/etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini
  45. ln -s /usr/local/etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini
  46.  
  47. cd $fscompilepath
  48.  
  49. ./configure --enable-core-odbc-support && make && make install
  50.  
  51. echo "You will need to populate the SERVER, USERNAME and PASSWORD values in the file: "$odbcini
Add Comment
Please, Sign In to add comment