diff options
-rwxr-xr-x | etc/functions/off | 7 |
1 files changed, 7 insertions, 0 deletions
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 |