Date: Fri, 4 Apr 2008 15:21:17 -0500 From: "Rance Hall" <ranceh@gmail.com> To: freebsd-questions@freebsd.org Subject: need a shell script that can be executed manually or as part of the rc process. How can the script detect WHERE it is being called from to know how to handle various options. Message-ID: <845c0f80804041321j44439881yb67458980edab102@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
I have a sh script im working on that is going to be able to run by the init/rc process. That same script can also be run after the system is started. I need a way to have the sh script detect WHERE in the boot process the server is when it is being executed. for example, once a login prompt appears there should be a getty running. prior to that time there shouldnt be a getty running, and if there isnt a gettty running, then the script must be called from the rc process and therefore I can do X instead of Y which I do when the system is fully operational. This is my thought process but I dont understand how to carry it out, or if the thought process actually makes sense. is there a better way for me to do what Im trying to do, and if there isnt and Im on the right track, how do I do what Im asking?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?845c0f80804041321j44439881yb67458980edab102>