#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          fliwi-mounts
# Required-Start:    fliwi-logical-volumes
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Updates the Fliwi-controlled mounts
# Description:       This is a init-wrapper around fliwi-update-mounts
#                    to care about setting up mounts.
### END INIT INFO

NAME=fliwi-mounts
YMCUPDATEMOUNTSEXEC=/usr/sbin/fliwi-update-mounts

. /lib/lsb/init-functions

test -x $YMCUPDATEMOUNTSEXEC || exit 0

do_start()
{
  $YMCUPDATEMOUNTSEXEC && return 0
  return 1
}

case "$1" in
  start)
    log_begin_msg "Updating mounts under control of Fliwi..."
    do_start
    log_end_msg $?
  ;;

  restart)
    do_start
  ;;

  stop)
  ;;

  reload|force-reload|force-stop|status)
    echo "Error: argument '$1' not supported" >&2
    exit 3
  ;;

  *)
    echo "Usage: /etc/init.d/$NAME {start|stop}"
    exit 3
  ;;
esac

exit 0
