Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Run a command on shutdown only?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
gregf
Tux's lil' helper
Tux's lil' helper


Joined: 14 May 2003
Posts: 102
Location: USA, Maine

PostPosted: Fri Oct 24, 2008 3:24 am    Post subject: Run a command on shutdown only? Reply with quote

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
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Fri Oct 24, 2008 4:53 am    Post subject: Reply with quote

An alias maybe?

alias halt='something && halt'
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Oct 24, 2008 8:01 am    Post subject: Reply with quote

Like so:
[[ ${SOFTLEVEL} == "shutdown" ]] && ewarn "Shutting down."

As opposed to:
[[ ${SOFTLEVEL} == "reboot" ]] && ewarn "Rebooting."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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