Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true; do
- 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
- case $yn in
- [Yy]* ) break;;
- [Nn]* ) exit;;
- * ) echo "Please answer yes to continue to installing ODBC and compiling FreeSWITCH, answer no to abort this process.";;
- esac
- done
- yum -y install unixODBC-devel mysql-connector-odbc
- odbcinst -j
- ln -s /usr/lib64/libmyodbc5.so /usr/lib/libmyodbc5.so
- ln -s /usr/lib64/libodbcmyS.so /usr/lib/libodbcmyS.so
- rm /etc/odbc.ini
- rm /etc/odbcinst.ini
- fscompilepath=/usr/local/src/freeswitch
- odbcinst=/usr/local/etc/odbcinst.ini
- echo "[MySQL]" > $odbcinst
- echo "Description = ODBC for MySQL" >> $odbcinst
- echo "Driver = /usr/lib/libmyodbc5.so" >> $odbcinst
- echo "Setup = /usr/lib/libodbcmyS.so" >> $odbcinst
- echo "Driver64 = /usr/lib64/libmyodbc5.so" >> $odbcinst
- echo "Setup64 = /usr/lib64/libodbcmyS.so" >> $odbcinst
- echo "FileUsage = 1" >> $odbcinst
- odbcini=/usr/local/etc/odbc.ini
- echo "[freeswitch]" > $odbcini
- echo "Driver = MySQL" >> $odbcini
- echo "SERVER = " >> $odbcini
- echo "PORT = 3306" >> $odbcini
- echo "DATABASE = freeswitch" >> $odbcini
- echo "OPTION = 67108864" >> $odbcini
- echo "USERNAME = " >> $odbcini
- echo "PASSWORD = " >> $odbcini
- ln -s /usr/local/etc/odbc.ini /etc/odbc.ini
- ln -s /usr/local/etc/odbcinst.ini /etc/odbcinst.ini
- ln -s /usr/local/etc/odbc.ini /usr/local/freeswitch/etc/odbc.ini
- ln -s /usr/local/etc/odbcinst.ini /usr/local/freeswitch/etc/odbcinst.ini
- cd $fscompilepath
- ./configure --enable-core-odbc-support && make && make install
- echo "You will need to populate the SERVER, USERNAME and PASSWORD values in the file: "$odbcini
Add Comment
Please, Sign In to add comment