From 668ac12684cedb7aa9297729b61bd4ad2c40d30f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 16 Feb 2009 19:54:06 +0100 Subject: off: optional argument for "permanent" shutdown (->pc will stay down for a while) --- etc/functions/off | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'etc') diff --git a/etc/functions/off b/etc/functions/off index 05b786d..85a62dd 100755 --- a/etc/functions/off +++ b/etc/functions/off @@ -8,6 +8,7 @@ typeset filesystem garbage typeset -a filesystems typeset tune2fs typeset -i force reboot simulate +typeset gone function execute { if (( simulate )) { @@ -37,6 +38,8 @@ while [[ $1 == -* ]] { shift } +gone=$1 + # Don't shut down a server too easily if [[ $force != 1 && $hosts[$HOST] == *:server:* ]] { warn "This seems to be a server... not shutting down" @@ -44,6 +47,10 @@ if [[ $force != 1 && $hosts[$HOST] == *:server:* ]] { return 1 } +if [[ -n $gone ]] { + execute unisync with-all +} + if pgrep -x amarokapp &> /dev/null; then execute dcop amarok MainApplication-Interface quit fi -- cgit v1.2.3