pentaval.init

#!/bin/bash
# PENTAVAL

PATH=/usr/bin:/bin:/bin:/usr/bin
export PATH

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

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

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

# check if the pentaval conf file is present
[ -f /etc/pentaval.conf ] || exit 0

pentavalt=/bin/pentavalt
pentavald=/bin/pentavald
pentavalm=/bin/pentavalm
prog="pentaval"

RETVAL=0

start() {
    echo -n $"Starting $prog: "
    $pentavalt -a -d pentaval0 -f /etc/pentaval.conf
    RETVAL=$?
#    [ $RETVAL -eq 0 ] && echo_success
#    [ $RETVAL -ne 0 ] && echo_failure
    echo
    return $RETVAL
}

stop() {
    echo -n  $"Stopping $prog: "
    $pentavalt -q
    RETVAL=$?
#    [ $RETVAL -eq 0 ] && echo_success
#    [ $RETVAL -ne 0 ] && echo_failure
    echo
    return $RETVAL
}   

restart() {
    stop
    start
}

# See how we were called.
case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    start
    ;;
  *)
    echo $"salah mas"
    echo $"Pakai ini mas: $prog {start|stop|restart}"
    exit 1
esac

exit $RETVAL



No Comment

Leave a Reply