#!/bin/sh
#
# lsapi-cache       Cache lsphp binaries
#
# chkconfig: 2345 11 91
# description: Cache in dynamic loader lsphp binaries and shared libraries 
# probe: false

# Source function library.
if [ -f /etc/init.d/functions ]; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ]; then
  . /etc/rc.d/init.d/functions
else
  echo "Could not find functions file, your system may be broken"
  exit 1
fi

if [ ! -f /etc/sysconfig/lsapi-cache ]; then
    exit 0
fi

. /etc/sysconfig/lsapi-cache

SCRIPT="/usr/share/lve/modlscapi/utils/lsapi-cache"

# See how we were called.
case "$1" in
  start)
        export LSAPICACHE_LOGFILE LSAPICACHE_LOAD_DIRS
        if [ -x "$SCRIPT" ]; then
            action "Caching lsphp libraries" "$SCRIPT"
        fi
  ;;
  stop)
  ;;
  restart)
        $0 stop
        $0 start
  ;;
  reload)
        $0 restart
  ;;
  *)
        echo "Usage: lsapi-cache {start|stop|restart|reload}"
        exit 1
esac

exit 0
