#! /bin/sh #---------------------------------------------------------------------------- # /var/install/bin/asterisk-update-lcr # # Creation: 2004-11-07 fw # Last Update: $Id$ # # Copyright (c) 2005 Fabian Wolter, fabian(at)eisfair(dot)org # Copyright (c) 2012-@@YEAR@@ Holger Bruenjes, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /var/install/include/eislib cron_exec=/etc/asterisk/lcr/tsblcrupdate.php cron_conf=/etc/asterisk/lcr/tsblcr.cfg cron_routing=/etc/asterisk/lcr/tsblcr.routing # --------------------------------------------------------------------------- # update LCR table # --------------------------------------------------------------------------- update_lcr() { mecho --info "Updating LCR Routingtable ..." /usr/bin/php -q -d output_buffering=off ${cron_exec} ${cron_conf} ${cron_routing} } # --------------------------------------------------------------------------- # check for executable # --------------------------------------------------------------------------- check_exec() { ret=1 if [ ! -f "${cron_exec}" ] then /var/install/bin/install-package -y -p 'asterisk-lcr' -v '2.7.0' ret="${?}" else ret=0 fi return ${ret} } # --------------------------------------------------------------------------- # main # --------------------------------------------------------------------------- main() { check_exec _ret=${?} if [ "${_ret}" -eq 0 ] then update_lcr fi } # --------------------------------------------------------------------------- # start # --------------------------------------------------------------------------- main "$@" # --------------------------------------------------------------------------- # end # ---------------------------------------------------------------------------