Hi,

This is mine.

It includes SqlBox as well.

Kannel was installed in /etc/kanne/ and SQL Box in /etc/sqlbox

Thanks.












------
loyc Cossou

On 27 October 2015 at 20:08, ha...@aeon.pk <ha...@aeon.pk> wrote:

> In case someone needs this.
>
> On Tue, Oct 27, 2015 at 5:02 PM, Loyc Cossou <loycos...@gmail.com> wrote:
>
>> Hi,
>>
>> I installed via CVS, but it did not solve my request. It was same as
>> downloading sources from kannel.org.
>>
>> Actually, wanted a script for script for start-stop to use via service
>> start/stop kannel. I know it's done automatically when kannel is installer
>> via yum or rpm.
>>
>> Finally I found the script and solved the issue.
>>
>> Thanks for support.
>>
>>
>>
>>
>>
>>
>>
>> ------
>> loyc Cossou
>>
>> On 23 October 2015 at 19:54, Loyc Cossou <loycos...@gmail.com> wrote:
>>
>>> Great,
>>>
>>> Let me test and update.
>>>
>>> Thanks
>>> Le 23 oct. 2015 13:34, "ha...@aeon.pk" <ha...@aeon.pk> a écrit :
>>>
>>>> Use SVN instead of RPM. Script is part of SVN snapshot.
>>>>
>>>> On Fri, Oct 23, 2015 at 1:41 AM, Loyc Cossou <loycos...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> How can I install kannel 1.4.4 on Centos via rpm package? Any
>>>>> repository for that? On Epel, there is only Kannel 1.4.3.
>>>>>
>>>>> In case I choose compiling, can anyone help me for start/stop script?
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ------
>>>>> loyc Cossou
>>>>>
>>>>
>>>>
>>
>
#!/bin/sh
#
# kannel        This script takes care of starting and stopping the kannel \
#               WAP gateway services (bearer/wap/smsbox).
# chkconfig: - 97 03
# description:  The Kannel WAP and SMS gateway services
# config: /etc/kannel.conf

### BEGIN INIT INFO
# Provides: kannel
# Required-Start: $local_fs $remote_fs $network $named
# Required-Stop: $local_fs $remote_fs $network
# Short-Description: start and stop Kannel WAP gateway services
# Description: Kannel is a set of daemons implementing WAP gateway services.
### END INIT INFO

# Use start-stop-kannel
prog="/etc/kannel/sbin/start-stop-daemon"
args="--start --background --chuid kannel:kannel --exec "
config="/etc/kannel.conf"
configSqlBox="/etc/kannel/sqlbox.conf"


# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f $config ] || exit 1

RETVAL=0
RETVAL_BEARER=0
RETVAL_WAP=0
RETVAL_SMS=0

start() {
        # Start daemons.
        echo -n "Démarrage de kannel BearerBox: "
        daemon $prog $args /etc/kannel/sbin/bearerbox $config
        RETVAL_BEARER=$?
        echo

        # It seems like the bearerbox may need to settle before accepting
        # connections from wapbox and smsbox
        sleep 3s

        # Starting wap and sms only makes sense if bearerbox is running
          if grep "^group = sqlbox" $configSqlBox &>/dev/null; then
            echo -n "Démarrage de SqlBox: "
            daemon $prog $args /etc/sqlbox/sbin/sqlbox $configSqlBox
            RETVAL_SMS=$?
            echo
          fi
        if [ $RETVAL_BEARER -eq 0 ]; then
          if grep "^group = wapbox" $config &>/dev/null; then
            echo -n "Démarrage de kannel WapBox: "
            daemon $prog $args /etc/kannel/sbin/wapbox $config
            RETVAL_WAP=$?
            echo
          fi
          if grep "^group = smsbox" $config &>/dev/null; then
            echo -n "Démarrage de kannel SMSBox: "
            daemon $prog $args /etc/kannel/sbin/smsbox $config
            RETVAL_SMS=$?
            echo
          fi
        fi
        [ $RETVAL_BEARER -eq 0 -a $RETVAL_WAP -eq 0 -a $RETVAL_SMS -eq 0 ] \
          && touch /var/lock/subsys/kannel || RETVAL=1
}

stop() {
        # Stop daemons.
        if grep "^group = sqlbox" $configSqlBox &>/dev/null; then
          echo -n "Arrêt de  kannel SqlBox: "
          killproc /etc/sqlbox/sbin/sqlbox
          RETVAL_SMS=$?
          echo
        fi
        if grep "^group = smsbox" $config &>/dev/null; then
          echo -n "Arrêt de  kannel SMSBox: "
          killproc /etc/kannel/sbin/smsbox
          RETVAL_SMS=$?
          echo
        fi
        if grep "^group = wapbox" $config &>/dev/null; then
          echo -n "Arrêt de down kannel WapBox: "
          killproc /etc/kannel/sbin/wapbox
          RETVAL_WAP=$?
          echo
        fi
        echo -n "Arrêt de kannel BearerBox: "
        killproc /etc/kannel/sbin/bearerbox
        RETVAL_BEARER=$?
        echo
        [ $RETVAL_BEARER -eq 0 -a $RETVAL_WAP -eq 0 -a $RETVAL_SMS -eq 0 ] \
          || RETVAL=1
        rm -f /var/lock/subsys/kannel
}

# See how we were called.
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  status)
        status /etc/kannel/sbin/bearerbox
        RETVAL_BEARER=$?
configSqlBox
        if grep "^group = sqlbox" $configSqlBox &>/dev/null; then
          status /etc/sqlbox/sbin/sqlbox
          RETVAL_WAP=$?
        fi
        if grep "^group = wapbox" $config &>/dev/null; then
          status /etc/kannel/sbin/wapbox
          RETVAL_WAP=$?
        fi
        if grep "^group = smsbox" $config &>/dev/null; then
          status /etc/kannel/sbin/smsbox
          RETVAL_SMS=$?
        fi
        [ $RETVAL_BEARER -eq 0 -a $RETVAL_WAP -eq 0 -a $RETVAL_SMS -eq 0 ] \
          || RETVAL=1
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|status}"
        RETVAL=1
esac

exit $RETVAL

Reply via email to