Google
  Web www.spinics.net

how to grab command line arguments in /bin/nash?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello

Am a RHEL noob, so pls excuse the naive question; Wanted to find out
if anyone has attempted to customize/edit your initrd's init script;
what I'd like to do is to be able to:

1. grab the /proc/cmdline arguments passed on during a pxeboot of a
diskless station
2. parse the commandline into variable so I can use to pass as
argument to a service that's called within the current init script.

Is this possible using /bin/nash? if so, how?

Example (snippet of init script)

- currently does this

echo Attaching to iSCSI storage
/bin/iscsistart -t iqn.2008-04.com.mylab.foo3:storage.foo -i
iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a 192.168.17.3

- I'd like to:
a. grab commandline parameters pass from the "APPEND" line in the
pxelinux.cfg/<configuration file>
b. place it in variable, so that I can simply edit the above command
and use the appropriate "target" value.

c. In bash, it would look something like this:

#!/bin/bash
#
|
|
var=` cat /proc/cmdline | cut -d " " -f6 | cut -d "=" -f2`
echo Attaching to iSCSI storage
/bin/iscsistart -t $var -i iqn.1994-05.com.redhat:a950ce57a2bb -g 1 -a
192.168.17.3
======

I am a linux newbie, and just realized that /bin/nash is really not
like bash ... any help or advise on how I can grab a commandline when
running the intrd's init script?

thanks in advance,

-- 
A S P A S I A
. . . . . . . . . . ..

_______________________________________________
Redhat-install-list mailing list
Redhat-install-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-install-list
To Unsubscribe Go To ABOVE URL or send a message to:
redhat-install-list-request@xxxxxxxxxx
Subject: unsubscribe

[Home]     [Red Hat Kickstart]     [Fedora Users]     [Red Hat General]     [Red Hat Watch List]     [Red Hat Development]     [Samba List]     [Kernel List]     [Kernel Newbies]     [Hot Springs]     [Yosemite News]

Powered by Linux