summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-02-16 19:54:06 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2009-02-16 19:54:06 +0100
commit668ac12684cedb7aa9297729b61bd4ad2c40d30f (patch)
tree7da498225ef7401f4a7452e9cad63e26546d8856 /etc/functions
parent5c015acd38faf4c992da264df039aeb074c93802 (diff)
off: optional argument for "permanent" shutdown (->pc will stay down for a while)
Diffstat (limited to 'etc/functions')
-rwxr-xr-xetc/functions/off7
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