forked from jonmatifa/zfsmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiff.cgi
More file actions
20 lines (17 loc) · 679 Bytes
/
Copy pathdiff.cgi
File metadata and controls
20 lines (17 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/perl
require './zfsmanager-lib.pl';
ReadParse();
use Data::Dumper;
ui_print_header(undef, $text{'diff_title'}, "", undef, 1, 1);
print "Snapshot: ".$in{'snap'};
@array = diff($in{'snap'}, undef);
%type = ('B' => 'Block device', 'C' => 'Character device', '/' => 'Directory', '>' => 'Door', 'F' => 'Regular file');
%action = ('-' => 'removed', '+' => 'created', 'M' => 'Modified', 'R' => 'Renamed');
print ui_columns_start([ "File", "Action", "Type" ]);
foreach $key (@array)
{
@file = split("\t", $key);
print ui_columns_row([ @file[2], $action{@file[0]}, $type{@file[1]} ]);
}
print ui_columns_end();
ui_print_footer("status.cgi?snap=$in{'snap'}", $in{'snap'});