Просмотр исходного кода

Only allow a shutdown if the projector is running

Zachary Kotlarek 13 лет назад
Родитель
Сommit
a7f2f22a1d
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      dmx/projectorPower.pl

+ 2 - 2
dmx/projectorPower.pl

@@ -80,12 +80,12 @@ while (1) {
 	}
 
 	# Record the shutdown timestamp
-	if ($newState eq 'SHUTDOWN') {
+	if ($exists{'PROJECTOR'} && $newState eq 'SHUTDOWN') {
 		$shutdown = time();
 	}
 
 	# Clear the shutdown timestamp if there is new user activity
-	if ($shutdown && $lastUser > $shutdown) {
+	if ($shutdown && (!$exists{'PROJECTOR'} || $lastUser > $shutdown)) {
 		$shutdown = 0;
 	}