View previous topic :: View next topic |
Author |
Message |
gregf Tux's lil' helper
Joined: 14 May 2003 Posts: 102 Location: USA, Maine
|
Posted: Fri Oct 24, 2008 3:24 am Post subject: Run a command on shutdown only? |
|
|
Anyone know of a decent way to run a command on poweroff or shutdown but not a restart? I know I can hack something together, but wondering if there is a nice way of doing it. I originally put it in conf.d/local.stop, but really would rather it not run during reboots. |
|
Back to top |
|
|
notHerbert Advocate
Joined: 11 Mar 2008 Posts: 2228 Location: 45N 73W
|
Posted: Fri Oct 24, 2008 4:53 am Post subject: |
|
|
An alias maybe?
alias halt='something && halt' |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Oct 24, 2008 8:01 am Post subject: |
|
|
Like so: | [[ ${SOFTLEVEL} == "shutdown" ]] && ewarn "Shutting down." |
As opposed to: | [[ ${SOFTLEVEL} == "reboot" ]] && ewarn "Rebooting." |
|
|
Back to top |
|
|
|