I everyone, I want to know how can I launch many script with reboot beetween each script ie : I launch script1 at start up then the system reboot and launch script2 then ... Thanks for all your answers -- Cordialement, / Greetings, Georghy FUSCO
From: Georghy <fusco at wanagain.net>> I want to know how can I launch many script with reboot beetween each script > ie : I launch script1 at start up then the system reboot and launch > script2 then ...Simple way would be to have a script that reads a file with a script on each line. If the file is not empty, it would read the first line, execute the script corresponding to that line, remove that line from the file and reboot. Rinse and repeat until the file is empty... JD
On Thu, Feb 11, 2010 at 12:13 PM, Georghy <fusco at wanagain.net> wrote:> I everyone, > I want to know how can I launch many script with reboot beetween each > script > ie : I launch script1 at start up then the system reboot and launch > script2 then ... > Thanks for all your answers > > -- > Cordialement, / Greetings, > Georghy FUSCO > > _______________________________________________ > > Simple :)1. Add a line to /etc/rc.local - for exmaple "sh /root/myscript" 2. /root/myscript's contents could look like this: sh /root/runfirst 3. Now, you have say /root/script1, /root/script2, /root/script3, etc. At the end of each script do this: rm -rf /root/script1 echo /root/script2 > /root/runfirst -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20100211/41fb2ded/attachment.html>
John Doe a ?crit :> From: Georghy <fusco at wanagain.net> > >> I want to know how can I launch many script with reboot beetween each script >> ie : I launch script1 at start up then the system reboot and launch >> script2 then ... >> > > Simple way would be to have a script that reads a file with a script on each line. > If the file is not empty, it would read the first line, execute the script corresponding to that line, remove that line from the file and reboot. > Rinse and repeat until the file is empty... > > JD > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos > >How do I launch a custom script at the startup? for exemple my script installation-script launch script 1, write in a file "prog" "script1 OK" then reboot at startup, the system relaunch installation-script, installation-script read the file "prog" an count 1 line so the script launch script2 ... Thank you so much -- Cordialement, / Greetings, Georghy FUSCO
Rudi Ahlers a ?crit :> > > On Thu, Feb 11, 2010 at 12:13 PM, Georghy <fusco at wanagain.net > <mailto:fusco at wanagain.net>> wrote: > > I everyone, > I want to know how can I launch many script with reboot beetween > each script > ie : I launch script1 at start up then the system reboot and launch > script2 then ... > Thanks for all your answers > > -- > Cordialement, / Greetings, > Georghy FUSCO > > _______________________________________________ > > Simple :) > > 1. Add a line to /etc/rc.local - for exmaple "sh /root/myscript" > 2. /root/myscript's contents could look like this: sh /root/runfirst > 3. Now, you have say /root/script1, /root/script2, /root/script3, etc. > At the end of each script do this: > > rm -rf /root/script1 > echo /root/script2 > /root/runfirst > > > > > > > -- > Kind Regards > Rudi Ahlers > SoftDux > > Website: http://www.SoftDux.com > Technical Blog: http://Blog.SoftDux.com > Office: 087 805 9573 > Cell: 082 554 7532 > ------------------------------------------------------------------------ > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >Thanks for your answer I'll try -- Cordialement, / Greetings, Georghy FUSCO
Georghy wrote on Thu, 11 Feb 2010 11:13:10 +0100:> I want to know how can I launch many script with reboot beetween each script > ie : I launch script1 at start up then the system reboot and launch > script2 then ...Why would you want to do this? One way would be to use a reboot counter, another to use lock files (run only the first script that hasn't run yet), yet another to enumerate the files and remove the first on each boot, yet another to have a file remove itself after run (may not work). Kai -- Get your web at Conactive Internet Services: http://www.conactive.com
John Doe a ?crit :> From: Georghy <fusco at wanagain.net> > >> your command works, but I want to watch the script running, in order to >> view errors, so I figured out that I have to launch the script after the >> user is connected thanks to .bachrc do you know how to do that ? >> > > Redirect stderr to a file? > > JD > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos > >this part works thanks :) -- Cordialement, / Greetings, Georghy FUSCO
John Doe a ?crit :> From: Georghy <fusco at wanagain.net> > >> for now i want to display the computer IP adress just before the user login >> but I want to display it before the user logon >> do you know how to do this ? >> > > check /etc/issue, but you might have to generate it on the fly with the IP hardcoded in it since it is not in the available variables (man mingetty). > > JD > > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos > >i tried to launch the script on the post install script of anaconda (kickstart file) but the network card seem not configured yet so I tried to replace the script on /etc/issues I will see if it worked -- Cordialement, / Greetings, Georghy FUSCO
Georghy a ?crit :> John Doe a ?crit : > >> From: Georghy <fusco at wanagain.net> >> >> >>> for now i want to display the computer IP adress just before the user login >>> but I want to display it before the user logon >>> do you know how to do this ? >>> >>> >> check /etc/issue, but you might have to generate it on the fly with the IP hardcoded in it since it is not in the available variables (man mingetty). >> >> JD >> >> >> >> _______________________________________________ >> CentOS mailing list >> CentOS at centos.org >> http://lists.centos.org/mailman/listinfo/centos >> >> >> > i tried to launch the script on the post install script of anaconda > (kickstart file) > but the network card seem not configured yet > so I tried to replace the script on /etc/issues > I will see if it worked > >It worked with /etc/issues thank you everyone :) -- Cordialement, / Greetings, Georghy FUSCO