The switch is in a state where user process can be run once the boot sequence has been halted (the aforementioned <ESC><SHIFT><9>). However the time between when the reboot is kicked off and when the asterisks appear (and the boot must be stopped), there is no shell Environment.
I may be trying to hammer a nail in with a wrench. So I'm going to do a little more digging into the switch code and get to a point where a shell script can be run as Alan suggested. Then I'll be back. Thanks all for the replies. Dave -----Original Message----- From: tutor-bounces+d.wilder=f5....@python.org [mailto:tutor-bounces+d.wilder=f5....@python.org] On Behalf Of Alan Gauld Sent: Wednesday, July 04, 2012 1:07 PM To: tutor@python.org Subject: Re: [Tutor] Python and boot sequences On 28/06/12 13:54, Dave Wilder wrote: > Can a Python script be written that has the ability to stop a Linux > device in the middle of a boot when a certain sequence occurs and then > perform an action? It depends... > For example, when I boot my switch (w/ Linux OS 2.7.3), I want to stop > the boot when I see a series of asterisks. When I see this, I need to > hit the <ESC><SHIFT><9> Could you do it with a bash script? If so you could do it with Python. But I've no idea whether your switch will be in a state to run user processes at that point in its boot sequence. If you don't have a shell environment its going to be a whole lot harder. > doing a PXE boot, ??? -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor