#!/bin/bash
#   /***************************************************************************
#   **                                                                        **
#   **  License                                                               **
#   **  =======                                                               **
#   **                                                                        **
#   **  This software program is released under the terms of a license        **
#   **  agreement between you ('Licensee') and Intel. Do not use or load this **
#   **  software or any associated materials (collectively, the 'Software')   **
#   **  until you have carefully read the full terms and conditions of the    **
#   **  LICENSE located in this software package. By loading or using the     **
#   **  Software, you agree to the terms of this Agreement. If you do not     **
#   **  agree with the terms of this Agreement, do not install or use the     **
#   **  Software.                                                             **
#   ***************************************************************************/
#
#   /***************************************************************************
#   **                                                                        **
#   ** INTEL CORPORATION                                                      **
#   **                                                                        **
#   ** This software is supplied under the terms of the license included      **
#   ** above.  All use of this software must be in accordance with the terms  **
#   ** of that license.                                                       **
#   **                                                                        **
#   **  Abstract:                                                             **
#   **    Initialization script for PROCfgd (Redhat)                          **
#   **                                                                        **
#   ***************************************************************************/
#
# procfgd    Init/kill procfgd 
# chkconfig: 2345 11 89
# description: Activates/Deactivates Intel(R) PRO LAN Adapters PROCfg Application 
#
# probe: true

init_cfg_file="saved_conf.procfgd"
init_cfg_dir="/etc/procfgd/"

if [ ! -f /etc/init.d/functions ]; then
    echo "unable to locate /etc/rc.d/init.d/functions - PROCfgd failed loading"
    exit 0
fi
# Source function library.
. /etc/init.d/functions

# See how we were called.
case "$1" in
    start)
        [ -x /usr/sbin/procfgd ] || exit 5
        action $"Starting procfgd: " touch /var/lock/subsys/procfgd
        /usr/sbin/procfgd
        sleep 1
        if [ -f $init_cfg_dir$init_cfg_file ]; then 
            [ -x /usr/sbin/procfg ] && /usr/sbin/procfg -f restore -b
        fi
        ;;
    stop)
        killall /usr/sbin/procfgd	
        action $"Stopping procfgd: " rm -f /var/lock/subsys/procfgd
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
esac

exit 0
