[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

script bash para kannel



Estimados:

luego de solucionar el problemita del script de fedora, puse el de
debian, como aconsejaron...
antes de comentarlo en ".bashrc" lo lei...
la verdad nunca arme un "bash" por eso les pido ayuda.

si bien lei y entendi que
CONF
es el directorio de la configuracion...
BOXPATH
es el directorio donde estan las aplicaciones.
PIDFILES
No se que es....
Yo utilizo :
bearerbox
smsbox
wapbox no utilizo por eso comente todo lo que refiere a el.

aun de esta manera, si lo inicio en bashrc no puedo abrir el terminal
de superusuario(root)
Y no funcion del todo bien.
bien el bearerbox arranca el smsbox no. tengo que abrirlo manualmente...

para que funcione sin el bash (manualmente) escribo estos dos comandos
en el terminal

Primero:
/usr/sbin/brearerbox /var/kannel.conf
espero unos segundo, que carge y...
Segundo:
/usr/sbin/smsbox /var/kannel.conf

aca les dejo el bash por las dudas.

> #!/bin/sh
> # Start/stop the Kannel boxes: One bearer box and one WAP box.
> # This is the default init.d script for Kannel. Its configuration is
> # appropriate for a small site running Kannel on one machine.
> # Make sure that the Kannel binaries can be found in $BOXPATH or somewhere
> # else along $PATH. run_kannel_box has to be in $BOXPATH.
> ### BEGIN INIT INFO
> # Provides: kannel
> # Required-Start: $local_fs $remote_fs
> # Required-Stop: $local_fs $remote_fs
> # Should-Start: $network $named
> # Should-Stop: $network $named
> # Default-Start: 2 3 4 5
> # Default-Stop: 0 1 6
> # Short-Description: SMS and WAP gateway
> # Description: Kannel is a gateway for connecting WAP phones to the
> # Internet. It also works as an SMS gateway.
> ### END INIT INFO
> . /lib/lsb/init-functions
> BOXPATH=/usr/sbin
> PIDFILES=/var/run/kannel
> CONF=/var/kannel.conf # ########## ak agrego el directorio donde esta la conf.
> PATH=$BOXPATH:$PATH
> # On Debian, the most likely reason for the bearerbox not being available
> # is that the package is in the "removed" or "unconfigured" state, and the
> # init.d script is still around because it's a conffile. This is normal,
> # so don't generate any output.
> test -x $BOXPATH/bearerbox || exit 0
> test -r /etc/default/kannel && . /etc/default/kannel
> if [ ! -d $PIDFILES ]
> then
> mkdir $PIDFILES
> chown kannel:root $PIDFILES
> fi
> case "$1" in
> start)
> log_daemon_msg "Starting WAP gateway"
> log_progress_msg "bearerbox"
> start-stop-daemon --start --quiet \
> --pidfile $PIDFILES/kannel_bearerbox.pid \
> --chuid kannel \
> --exec $BOXPATH/run_kannel_box \
> -- \
> --pidfile $PIDFILES/kannel_bearerbox.pid \
> --no-extra-args \
> $BOXPATH/bearerbox -v 4 -- $CONF
> sleep 1 # Wait for bearerbox
> # test ! -z $START_WAPBOX && (
> # log_progress_msg "wapbox"
> # start-stop-daemon --start --quiet \
> # --pidfile $PIDFILES/kannel_wapbox.pid \
> # --chuid kannel \
> # --exec $BOXPATH/run_kannel_box \
> # -- \
> # --pidfile $PIDFILES/kannel_wapbox.pid \
> # --no-extra-args \
> # $BOXPATH/wapbox -v 4 -- $CONF )
> test ! -z $START_SMSBOX && (
> log_progress_msg "smsbox"
> start-stop-daemon --start --quiet \
> --pidfile $PIDFILES/kannel_smsbox.pid \
> --chuid kannel \
> --exec $BOXPATH/run_kannel_box \
> -- \
> --pidfile $PIDFILES/kannel_smsbox.pid \
> --no-extra-args \
> $BOXPATH/smsbox -v 4 -- $CONF
> )
> log_end_msg 0
> ;;
> stop)
> log_daemon_msg "Stopping WAP gateway"
> test ! -z $START_SMSBOX && (
> log_progress_msg "smsbox"
> start-stop-daemon --stop --retry 5 --quiet \
> --pidfile $PIDFILES/kannel_smsbox.pid \
> --exec $BOXPATH/run_kannel_box
> )
> # test ! -z $START_WAPBOX && (
> # log_progress_msg "wapbox"
> # start-stop-daemon --stop --retry 5 --quiet \
> # --pidfile $PIDFILES/kannel_wapbox.pid \
> # --exec $BOXPATH/run_kannel_box )
> log_progress_msg "bearerbox"
> start-stop-daemon --stop --retry 5 --quiet \
> --pidfile $PIDFILES/kannel_bearerbox.pid \
> --exec $BOXPATH/run_kannel_box
> log_end_msg 0
> ;;
> reload)
> # We don't have support for this yet.
> exit 1
> ;;
> restart|force-reload)
> $0 stop
> sleep 1
> $0 start
> ;;
> *)
> echo "Usage: $0 {start|stop|restart|force-reload}"
> exit 1
> esac
> exit 0


Reply to: