View previous topic :: View next topic |
Author |
Message |
tomalok n00b
Joined: 11 Jul 2002 Posts: 30
|
Posted: Mon Nov 25, 2002 11:33 pm Post subject: detecting reboot in rc script |
|
|
I have an rc script that takes a long time to 'stop'. However, when rebooting or shutting down, the stuff that 'stop' does doesn't really need to be done.
Is there a way with the gentoo rc script system (etc.) that I can detect whether or not the system's going to halt/reboot? |
|
Back to top |
|
|
lx Veteran
Joined: 28 May 2002 Posts: 1012 Location: Netherlands
|
Posted: Tue Nov 26, 2002 11:18 am Post subject: |
|
|
runlevel returns previous and current runlevel, so you could parse the outcome to check the current runlevel to see if it's 0 or 6. The man runlevel states that it's also available as variable RUNLEVEL and PREVLEVEL, but I haven't checked this,
Hope this helps,
Cya lX. _________________ "Remember there's a big difference between kneeling down and bending over.", Frank Zappa |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|