summaryrefslogtreecommitdiffstats
path: root/move/tree/wait4x
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-26 14:14:20 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-26 14:14:20 +0000
commit78ab4a427f77dd88c6d793bae2f9f953e556c3b7 (patch)
tree4a71560526e41d5c28c2ef20576eb0c3366be8aa /move/tree/wait4x
parenta9d3ceafe12844e022fb835b45eb22494d2c92ed (diff)
downloaddrakx-78ab4a427f77dd88c6d793bae2f9f953e556c3b7.tar
drakx-78ab4a427f77dd88c6d793bae2f9f953e556c3b7.tar.gz
drakx-78ab4a427f77dd88c6d793bae2f9f953e556c3b7.tar.bz2
drakx-78ab4a427f77dd88c6d793bae2f9f953e556c3b7.tar.xz
drakx-78ab4a427f77dd88c6d793bae2f9f953e556c3b7.zip
we can't keep perl in memory if we want to eject cdrom
Diffstat (limited to 'move/tree/wait4x')
-rwxr-xr-xmove/tree/wait4x21
1 files changed, 21 insertions, 0 deletions
diff --git a/move/tree/wait4x b/move/tree/wait4x
new file mode 100755
index 000000000..e8c2cfaba
--- /dev/null
+++ b/move/tree/wait4x
@@ -0,0 +1,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/\b$_[0]\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;