source: MondoRescue/branches/3.3/MondoRescue/bin/mr-device-mounted@ 3742

Last change on this file since 3742 was 3742, checked in by Bruno Cornec, 4 years ago

Fix non working mr-device-mounted

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/usr/bin/perl -w
2#
3# $Id$
4# Copyright B. Cornec 2005-2015
5# Provided under the GPL v2
6#
7# Test mr_device_mounted to know if a device is mounted
8#
9use strict;
10use Data::Dumper;
11# For pbdebug
12use ProjectBuilder::Base;
13use MondoRescue::Version;
14use MondoRescue::Disk;
15
16=pod
17
18=head1 NAME
19
20mr-device-mounted query whether a device is mounted or not
21
22=head1 DESCRIPTION
23
24mr-device-mounted query whether a device is mounted or not
25
26=head1 SYNOPSIS
27
28mr-device-mounted /path/to/device
29
30=head1 ARGUMENTS
31
32=over 4
33
34=item B</path/to/device>
35
36This is the path of the device name to query
37
38=back
39
40=head1 WEB SITES
41
42The main Web site of the project is available at L<http://www.mondorescue.org>. Bug reports should be filled using the trac instance of the project at L<http://trac.mondorescue.org/>.
43
44=head1 USER MAILING LIST
45
46For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
47
48=head1 AUTHORS
49
50The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
51
52=head1 COPYRIGHT
53
54MondoRescue is distributed under the GPL v2.0 license or later,
55described in the file C<COPYING> included with the distribution.
56
57=cut
58
59if ((defined $ARGV[0]) && ($ARGV[0] eq "-v")) {
60 shift;
61 $pbdebug = 2;
62}
63
64my $ans = "";
65
66if (defined $ARGV[0]) {
67 foreach my $i (@ARGV) {
68 my $txt = "";
69 my $txt2 = "";
70 $ans = mr_device_mounted($i);
71 $txt = " not" if (not defined $ans);
72 $txt2 = " on $ans" if (defined $ans);
73 pb_log(0, "Device $i is$txt mounted$txt2\n");
74 }
75}
76
77# In case we gave only one param (MondoRescue) then return 0 for success, 1 otherwise
78if (not defined $ARGV[1]) {
79 exit(0) if (defined $ans);
80 exit(1);
81}
Note: See TracBrowser for help on using the repository browser.