sorry last patch was sent while i was almost half asleep :P here's a bit more 
decent one :P

> Why did you looking at "echo"s path for BMC_CONFIG?
> <  BMC_CONFIG=$(which bmc-config 2>/dev/null) || {
> >  BMC_CONFIG=$(which echo 2>/dev/null) || {

debug line sneeked in :( my bad..

> If you want to know the install prefix this his how you should do.
> Add your bmc-autoconfig as bmc-autoconfig.in. Let autoconf rewrite
> @prefix@ variable with the path info. Also you need to add
> fish/scripts/bmc-config/bmc-autoconfig line to AC_CONFIG_FILES in
> configure.ac.

probably not needed for bmc-autoconfig.. should it? if it needs i'll do that 
too.. i think bmc-autconfig is fine without it.
 
> Next time when you submit a patch, please follow these guide lines:
> --------------------------------------------------------------------
>  # ls
> freeipmi
> freeipmi-hacked
> # diff -pruN freeipmi freeipmi-hacked > NAME_OF_FIX-FREEIPMI_VER.diff


i think cvs diff is more convinient for both the submitter and the maintainer..


> Mail the patch as inline mail message to freeipmi-devel (@) gnu.org
> with subject: [PATCH: freeipmi] actual subject

yes, did that this time.

> --------------------------------------------------------------------
> If not submit through Savannah web interface :p

will try that one day :P

> PS: Your from-address is broken - <[EMAIL PROTECTED]> ??

thanks for pointing...

regards,
avati
diff -pruN freeipmi/doc/freeipmi.texi freeipmi-hacked/doc/freeipmi.texi
--- freeipmi/doc/freeipmi.texi  2005-08-27 15:59:44.000000000 +0530
+++ freeipmi-hacked/doc/freeipmi.texi   2005-10-14 00:26:47.000000000 +0530
@@ -53,6 +53,7 @@ release @value{VERSION} of the GNU FreeI
 * fish::                        FreeIPMI SHell.
 * bmc-config::                  Baseboard Management Controller configurator.
 * bmc-info::                    Baseboard Management Controller information.
+* bmc-autoconfig::              Wizard-like frontend for bmc-config.
 * ipmi-sensors::                @acronym{IPMI} sensors utility.
 * ipmi-sel::                    @acronym{IPMI} System Event Log.
 * bmc-watchdog::                Watchdog daemon.
@@ -902,7 +903,7 @@ Section LAN_Conf_Auth
 EndSection
 @end example
 
[EMAIL PROTECTED] bmc-info, ipmi-sensors, bmc-config, Top
[EMAIL PROTECTED] bmc-info, bmc-autoconfig, bmc-config, Top
 @chapter bmc-info
 @pindex bmc-info
 @command{bmc-info} command displays BMC/@acronym{IPMI} version information and
@@ -944,7 +945,26 @@ Aux Firmware Revision Info: Boot Code v0
 debian-ia64:~# 
 @end example
 
[EMAIL PROTECTED] ipmi-sensors, ipmi-sel, bmc-info, Top
[EMAIL PROTECTED] bmc-autoconfig, ipmi-sensors, bmc-info, Top
[EMAIL PROTECTED] bmc-autoconfig
[EMAIL PROTECTED] bmc-autoconfig
[EMAIL PROTECTED] utility is a wizard-like frontend to the
[EMAIL PROTECTED] command, which has a curses/text based interfaced
+questionaire asking for IP/Netmask/Gateway to be committed.
+
[EMAIL PROTECTED] Command-line options
[EMAIL PROTECTED] @bullet
[EMAIL PROTECTED] -u, --usage @*
+      Show short usage message.
+
[EMAIL PROTECTED] -h, --help @*
+      Show help.
+
[EMAIL PROTECTED] -V, --version @*
+      Show version information.
[EMAIL PROTECTED] itemize
+
[EMAIL PROTECTED] ipmi-sensors, ipmi-sel, bmc-autoconfig, Top
 @chapter ipmi-sensors
 @pindex ipmi-sensors
 @command{ipmi-sensors} utility reports the monitored system health
diff -pruN freeipmi/fish/scripts/bmc-autoconfig/bmc-autoconfig 
freeipmi-hacked/fish/scripts/bmc-autoconfig/bmc-autoconfig
--- freeipmi/fish/scripts/bmc-autoconfig/bmc-autoconfig 2005-10-12 
19:04:33.000000000 +0530
+++ freeipmi-hacked/fish/scripts/bmc-autoconfig/bmc-autoconfig  2005-10-14 
00:27:17.000000000 +0530
@@ -24,6 +24,10 @@ _init ()
     # autotool'ize these two?
     TEMPLATE_DIR="/var/lib/freeipmi";
     TEMPLATE="${TEMPLATE_DIR}/bmc-config-template";
+    VERSION="0.1";
+    ME=$(basename ${0});
+    SUPPORT_EMAIL="[EMAIL PROTECTED]";
+    DESCRIPTION="${ME} is an autoconfiguration tool and wrapper around 
bmc-config"
 
     PROG=$(which dialog 2>/dev/null || which whiptail 2>/dev/null);
 
@@ -32,6 +36,7 @@ _init ()
        return 1;
     }
 
+
     exec 3>&1
 
     ip="0.0.0.0";
@@ -72,7 +77,7 @@ validate_ip_address ()
 
     quad=${1}
     
-    echo "${oct}" | grep -Eq "^[0-9\.]+$" || {
+    echo "${quad}" | grep -Eq "^[0-9\.]+$" || {
        echo "ERROR: Input cannot have non-numericals";
        return 1;
     }
@@ -137,14 +142,45 @@ accept_input ()
 
 main ()
 {
-    ip=$(accept_input get_ip_address validate_ip_address) &&
-    nm=$(accept_input get_netmask validate_ip_address) &&
-    gw=$(accept_input get_gateway_ip_address validate_ip_address) && {
-       ${BMC_CONFIG} --commit -f "${TEMPLATE}";
-       ${BMC_CONFIG} --commit -k "Lan_Conf:IP_Address=${ip}";
-       ${BMC_CONFIG} --commit -k "Lan_Conf:Subnet_Mask=${nm}";
-       ${BMC_CONFIG} --commit -k "Lan_Conf:Default_Gateway_IP_Address=${gw}";
-    }
+    case "${1}" in 
+       '--usage'|'-u')
+           cat <<EOF
+Usage: ${ME} [-?V] [--help] [--usage] [--version]
+EOF
+           ;;
+       '--help'|'-h')
+           cat <<EOF
+Usage: ${ME} [OPTION...]
+${DESCRIPTION}
+
+  -h, --help          Give this help list
+  -u, --usage         Give a short usage message
+  -V, --version       Print program version
+
+Report bugs to ${SUPPORT_EMAIL}
+EOF
+           ;;
+       '--version'|'-V')
+           echo ${ME} ${VERSION};
+           ;;
+       '')
+           ip=$(accept_input get_ip_address validate_ip_address) &&
+           nm=$(accept_input get_netmask validate_ip_address) &&
+           gw=$(accept_input get_gateway_ip_address validate_ip_address) && {
+               ${BMC_CONFIG} --commit -f "${TEMPLATE}";
+               ${BMC_CONFIG} --commit -k "Lan_Conf:IP_Address=${ip}";
+               ${BMC_CONFIG} --commit -k "Lan_Conf:Subnet_Mask=${nm}";
+               ${BMC_CONFIG} --commit -k 
"Lan_Conf:Default_Gateway_IP_Address=${gw}";
+           }
+           ;;
+       *)
+           cat <<EOF
+${ME}: invalid option -- ${1}
+Try \`${ME} --help' or \`${ME} --usage' for more information.
+EOF
+       
+    esac
+
 }
 
 _init "$@" && main "$@";
_______________________________________________
Freeipmi-devel mailing list
Freeipmi-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/freeipmi-devel

Reply via email to