summaryrefslogtreecommitdiffstats
path: root/move/tree/wait4x
blob: 40655e94c4a2a5a503a53db892e5ca4383a03340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use MDK::Common;
use lib qw(/usr/lib/libDrakX);
use c;

my $nb = 0;
$| = 1;
print "waiting for X";
foreach (1..30) {
    print ".";
    sleep 1;
    print("no X server :(\n"), exit 1 if !fuzzy_pidofs(qr/\bX_move\b/);
    $nb++ if c::Xtest(':0');
    if ($nb > 2) { #- one succeeded test is not enough :-(
        print "found\n";
        exit 0;
    }
}
print "not found\n";
exit 1;