#!/bin/sh -x 


. /opt/novell/ncs/lib/ncsfuncs 
DHCPD_ARGS="" 
if [ -s /etc/sysconfig/dhcpd ]; then 
  . /etc/sysconfig/dhcpd 


  if [ -n "$DHCPD_RUN_AS" ]; then 
    DHCPD_RUN_AS_GROUP="$(getent group $(getent passwd $DHCPD_RUN_AS | cut -d: -f4) | cut -d: -f1)" 
    DHCPD_ARGS="$DHCPD_ARGS -user $DHCPD_RUN_AS -group $DHCPD_RUN_AS_GROUP" 
  fi 


  if [ -n "$DHCPD_INTERFACE" ]; then 
    unset interfaces 
    if [ -x /sbin/getcfg-interface ]; then 
      for i in $DHCPD_INTERFACE; do 
        interfaces="$interfaces$(/sbin/getcfg-interface $i) " 
      done 
    fi 
    DHCPD_ARGS="$DHCPD_ARGS $interfaces" 
  fi 
fi 


MOUNT_POINT="/media/nss/<DHCP_VOLUME>" 
# start dhcpd 
exit_on_error /usr/sbin/dhcpd -cf $MOUNT_POINT/etc/dhcpd.conf -lf $MOUNT_POINT/var/lib/dhcp/db/dhcpd.leases $DHCPD_ARGS 
