#!/bin/bash
#
# snfs         Mount network filesystems.
#
# Authors:      Patrice Dumas <dumas@centre-cired.fr>
#
# chkconfig: 345 24 75
# description: Takes care of starting rpc_pserv

# Source networking configuration.
if [ ! -f /etc/sysconfig/network ]; then
    exit 0
fi

export ORIGINAL_PATH=$PATH

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

export PATH=$PATH:$ORIGINAL_PATH

. /etc/sysconfig/network

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

prog=rpc_psrv

case "$1" in
  start)
    if snfsmount -a ;then
      act=true
    else
      act=false
    fi
    action $"Starting $prog:" $act
    ;;
  stop)
    if snfsumount -a ;then
      act=true
    else
      act=false
    fi
    action $"Shutting down $prog:" $act
    ;;
  status)
    snfspsrv
    ;;
  restart)
    $0 stop
    $0 start
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

if [ ! -z $act ]; then
    $act
    exit $?
fi
