[Petter Reinholdtsen]
> I would rather have a plugin interface where those with special
> needs can put something in a .d directory and use this to decide if
> it is safe to turn off the computer or not.  Then you and others
> with similar needs can put whatever special rule you want in the .d
> directory and be happy.

Can you test this patch, and see if it solve your problem?  You can
add executable code in /etc/shutdown-at-night/unused.d/ to test what
you want to test and avoid the shutdown if it return false.

Index: shutdown-at-night
===================================================================
--- shutdown-at-night   (revisjon 74928)
+++ shutdown-at-night   (arbeidskopi)
@@ -70,6 +70,14 @@
     if (( $(cat /proc/uptime  | awk '{print int($1)}') < 3600 )) ; then
         return 1
     fi
+    unusedd=/etc/shutdown-at-night/unused.d
+    if [ -d $unusedd ] ; then
+        for f in $unusedd/* ; do
+            if [ -x $f ] && ! $f ; then
+                return 1
+            fi
+        done
+    fi
     return 0
 }
 
-- 
Happy hacking
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to