[CentOS] Launch many scripts with reboot

Les Mikesell lesmikesell at gmail.com
Thu Feb 11 16:48:33 UTC 2010

On 2/11/2010 9:56 AM, Georghy wrote:
> Les Mikesell a écrit :
>> Georghy wrote:
>>>> Do these need to run as root?  And do they really need to wait for a user to log
>>>> in or can they write their output to a file to be viewed later?  You can put a
>>>> line in /etc/rc.d/rc.local to run your script which you can change each time as
>>>> you want.  And you can add>>/path/to/logfile on the command if you want it to
>>>> be saved.   If you want something to run as the user at login, it can go in
>>>> .profile or .bash_profile in the user's home directory.
>>> I use .bash_profile and it works great
>>> for now i want to display the computer IP adress just before the user login
>>> my command is :
>>> ifconfig | grep "inet addr" | awk '{print $2}' | sed s/addr:// | head -n 1
>>> and it works after logon
>>> but I want to display it before the user logon
>>> do you know how to do this ?
>> The same commands work but the hard part is knowing where to display before
>> someone logs in.  Is this a text console or do you have a graphic login box showing?
>> And by the way, you don't need a pipeline of 4 commands to grab a bit of text.
>> Sed can do everything that grep does and more, awk can do anything sed can do.
>> If you use one of the more powerful commands you might as well let it do all the
>> work instead of building a pipeline.
> I want to display the IP adress of the computer for the user
> then he knows what IP use in order to launch a ssh connection
> In addition, we want to display it after a kickstart installation
> so I want to put this command in the kickstart
> then after the installation reboot it can display the IP adress of the
> computer

You didn't answer the question.  _Where_ do you want to display this IP 
address?  Before login there is no output stream or location associated 
with a user - or really even for the machine, although there is some 
concept of a console where output lands during bootup for most machines.

   Les Mikesell
    lesmikesell at gmail.com

More information about the CentOS mailing list