File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 19
19
$ cycleVarName ='ThisComputer. ' .str_replace ('.php ' , '' , basename (__FILE__ )).'Run ' ;
20
20
21
21
$ objects = getObjectsByClass ('systemStates ' );
22
- $ total = count ($ objects );
22
+ if (is_array ($ objects ) || $ objects instanceof Countable) {
23
+ $ total = count ($ objects );
24
+ echo $ total . " objects by class systemStates. " . "\n" ;
25
+ } else {
26
+ $ total = 0 ;
27
+ echo "No systemStates objects found.... " . "\n" ;
28
+ exit ;
29
+ }
23
30
24
31
if ($ _GET ['once ' ])
25
32
{
33
+
34
+ echo "Runing once....... " ;
26
35
$ last_run = getGlobal ((str_replace ('.php ' , '' , basename (__FILE__ ))) . 'Run ' );
27
36
28
37
if ((time () - $ last_run ) > 5 * 60 )
34
43
}
35
44
}
36
45
37
- echo "OK " ;
46
+ echo "OK " . "\n" ;
47
+ exit ;
38
48
}
39
49
else
40
50
{
54
64
}
55
65
}
56
66
57
- if (file_exists ('./reboot ' ) || IsSet ($ _GET ['onetime ' ]))
58
- {
59
- exit ;
67
+ if (isRebootRequired () || IsSet ($ _GET ['onetime ' ])) {
68
+ exit ;
60
69
}
61
70
62
71
sleep (1 );
You can’t perform that action at this time.
0 commit comments