#!/bin/bash cd /usr/src/mor/sh_scripts . install_configs.sh . mor_install_functions.sh # #db_calls_confirm_to_proceed(){ call_count=`mysql -h "$DB_HOST" -u "$DB_USERNAME" -p"$DB_PASSWORD" "$DB_NAME" -e "SELECT COUNT(*) FROM calls" | egrep -v '[a-Z]'` if [ "$call_count" -ge '500000' ]; then #clear echo echo echo echo echo echo echo echo echo " !!!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!" echo "There are more than 500.000 calls in database, proceeding with upgrade without any appropriate actions could lead asterisk and GUI services" echo "to slowdown or stop for a long time while database upgrade process is active. So here is what you can do:" echo "1. If you don't have active calls and you know that your system hardware is fast enough, just press ENTER and attept to upgrade database with-" echo "out any further warnings or notices." echo "2. Export calls from database , then upgrade it and import old calls back to database (Notice: this requires advanced MySQL knowledge)." echo "3. Search http://forum.kolmisoft.com/ for more info." echo echo echo echo echo "If you are not sure what to do, press CTRL+C to abort this task" read else echo "Calls in DB: $call_count. Work can proceed." fi # #}