Last change
on this file since 3713 was 3650, checked in by Bruno Cornec, 7 years ago |
- Fix versions given back for mr-* tools
- Log pb and mr versions in mindi log
- mr-getparam now prints a version
|
-
Property svn:executable
set to
*
|
File size:
1.6 KB
|
Rev | Line | |
---|
[3553] | 1 | #!/usr/bin/perl -w
|
---|
| 2 | #
|
---|
| 3 | # $Id$
|
---|
| 4 | # Copyright B. Cornec 2005-2016
|
---|
| 5 | # Provided under the GPL v2
|
---|
| 6 | #
|
---|
| 7 | # Test mr_disk_type to detect whether a disk is MBR or GPT
|
---|
| 8 | #
|
---|
| 9 | use strict;
|
---|
| 10 | use Data::Dumper;
|
---|
| 11 | # For pbdebug
|
---|
| 12 | use ProjectBuilder::Base;
|
---|
[3650] | 13 | use MondoRescue::Version;
|
---|
[3553] | 14 | use MondoRescue::Disk;
|
---|
| 15 |
|
---|
| 16 | =pod
|
---|
| 17 |
|
---|
| 18 | =head1 NAME
|
---|
| 19 |
|
---|
| 20 | mr-disk-type query whether a device has a MBR of GPT partition format
|
---|
| 21 |
|
---|
| 22 | =head1 DESCRIPTION
|
---|
| 23 |
|
---|
| 24 | mr-disk-type query whether a device has a MBR of GPT partition format
|
---|
| 25 |
|
---|
| 26 | =head1 SYNOPSIS
|
---|
| 27 |
|
---|
| 28 | mr-disk-tye /path/to/device
|
---|
| 29 |
|
---|
| 30 | =head1 ARGUMENTS
|
---|
| 31 |
|
---|
| 32 | =over 4
|
---|
| 33 |
|
---|
| 34 | =item B</path/to/device>
|
---|
| 35 |
|
---|
| 36 | This is the path of the device name to query
|
---|
| 37 |
|
---|
| 38 | =back
|
---|
| 39 |
|
---|
| 40 | =head1 WEB SITES
|
---|
| 41 |
|
---|
| 42 | The 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 |
|
---|
| 46 | For community exchanges around MondoRescue please use the list L<http://sourceforge.net/mailarchive/forum.php?forum_name=mondo-devel>
|
---|
| 47 |
|
---|
| 48 | =head1 AUTHORS
|
---|
| 49 |
|
---|
| 50 | The MondoRescue team lead by Bruno Cornec L<mailto:bruno@mondorescue.org>.
|
---|
| 51 |
|
---|
| 52 | =head1 COPYRIGHT
|
---|
| 53 |
|
---|
| 54 | MondoRescue is distributed under the GPL v2.0 license or later,
|
---|
| 55 | described in the file C<COPYING> included with the distribution.
|
---|
| 56 |
|
---|
| 57 | =cut
|
---|
| 58 |
|
---|
| 59 | if ((defined $ARGV[0]) && ($ARGV[0] eq "-v")) {
|
---|
| 60 | shift;
|
---|
| 61 | $pbdebug = 2;
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | my $txt = "";
|
---|
| 65 | my $txt2 = "";
|
---|
| 66 | my $ans = "";
|
---|
| 67 |
|
---|
| 68 | if (defined $ARGV[0]) {
|
---|
| 69 | foreach my $i (@ARGV) {
|
---|
| 70 | $ans = mr_disk_type($i);
|
---|
[3592] | 71 | pb_log(2, "Device $i has a $ans partition type\n");
|
---|
| 72 | pb_log(0, "$ans\n");
|
---|
[3553] | 73 | }
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | # In case we gave only one param (MondoRescue) then return 0 for success, 1 otherwise
|
---|
| 77 | if (not defined $ARGV[1]) {
|
---|
| 78 | exit(0) if (defined $ans);
|
---|
| 79 | exit(1);
|
---|
| 80 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.