1 |
diff -urN e-smith-backup-2.2.0.po/root/etc/e-smith/db/configuration/migrate/30lcSmbShare e-smith-backup-2.2.0.new/root/etc/e-smith/db/configuration/migrate/30lcSmbShare |
2 |
--- e-smith-backup-2.2.0.po/root/etc/e-smith/db/configuration/migrate/30lcSmbShare 1970-01-01 10:00:00.000000000 +1000 |
3 |
+++ e-smith-backup-2.2.0.new/root/etc/e-smith/db/configuration/migrate/30lcSmbShare 2010-01-30 18:54:56.000000000 +1100 |
4 |
@@ -0,0 +1,6 @@ |
5 |
+{ |
6 |
+ my $SmbShare = $DB->get_prop('backupwk', 'SmbShare'); |
7 |
+ return unless defined $SmbShare; |
8 |
+ $SmbShare = lc("$SmbShare"); |
9 |
+ $DB->set_prop('backupwk', 'SmbShare', $SmbShare) |
10 |
+} |
11 |
diff -urN e-smith-backup-2.2.0.po/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.2.0.new/root/etc/e-smith/events/actions/workstation-backup-dar |
12 |
--- e-smith-backup-2.2.0.po/root/etc/e-smith/events/actions/workstation-backup-dar 2010-01-30 03:05:13.000000000 +1100 |
13 |
+++ e-smith-backup-2.2.0.new/root/etc/e-smith/events/actions/workstation-backup-dar 2010-01-31 14:51:32.000000000 +1100 |
14 |
@@ -132,8 +132,35 @@ |
15 |
} |
16 |
elsif ($VFSType eq 'usb') |
17 |
{ |
18 |
- $err = qx(/bin/mount "/$smbshare" 2>&1); |
19 |
- if ($err) {ldie("Error while mounting /$smbshare : \n" . $err)}; |
20 |
+ my $device = ""; |
21 |
+ my $blkdev = ""; |
22 |
+ my $vollbl = ""; |
23 |
+ foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) { |
24 |
+ $udi =~ m/^(\S+)/; |
25 |
+ my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted); |
26 |
+ |
27 |
+ if ($is_mounted eq "false\n") { |
28 |
+ $blkdev = qx(hal-get-property --udi $1 --key block.device); |
29 |
+ $blkdev =~ m/^(\S+)/; |
30 |
+ } |
31 |
+ if ($is_mounted eq "false\n") { |
32 |
+ $vollbl = qx(hal-get-property --udi $1 --key volume.label); |
33 |
+ $vollbl =~ m/^(\S+)/; |
34 |
+ if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';} |
35 |
+ } |
36 |
+ |
37 |
+ chomp $vollbl; |
38 |
+ chomp $blkdev; |
39 |
+ $vollbl = lc("media/$vollbl"); |
40 |
+ if ($vollbl eq $smbshare) { |
41 |
+ $device = $blkdev; |
42 |
+ } |
43 |
+ } |
44 |
+ |
45 |
+ system("/bin/mkdir -p /$smbshare"); |
46 |
+ |
47 |
+ $err = qx(/bin/mount $device "/$smbshare" 2>&1); |
48 |
+ if ($err) {ldie("Error while mounting $device /$smbshare : \n" . $err)}; |
49 |
$mntdir = "/$smbshare"; |
50 |
} |
51 |
else |
52 |
diff -urN e-smith-backup-2.2.0.po/root/etc/e-smith/web/functions/backup e-smith-backup-2.2.0.new/root/etc/e-smith/web/functions/backup |
53 |
--- e-smith-backup-2.2.0.po/root/etc/e-smith/web/functions/backup 2010-01-30 03:05:13.000000000 +1100 |
54 |
+++ e-smith-backup-2.2.0.new/root/etc/e-smith/web/functions/backup 2010-01-31 15:05:32.000000000 +1100 |
55 |
@@ -349,16 +349,6 @@ |
56 |
) |
57 |
),"\n"; |
58 |
|
59 |
- #print esmith::cgi::genWidgetRow( |
60 |
- # $q, |
61 |
- # $fm->localise("SELECT_AN_ACTION"), |
62 |
- # $q->popup_menu ( |
63 |
- # -name => 'function', |
64 |
- # -values => [ @labels ], |
65 |
- # -default => $default_action, |
66 |
- # -labels => \%labels |
67 |
- # ) |
68 |
- #); |
69 |
} |
70 |
|
71 |
print $q->end_table,"\n"; |
72 |
@@ -1226,14 +1216,15 @@ |
73 |
$q, undef, $fm->localise('CONFIGURE_WORKSTN_BACKUP')); |
74 |
|
75 |
if ( $VFSType eq 'usb' ) { |
76 |
- my @usbdisklist; |
77 |
- @usbdisklist = qx'ls /media'; |
78 |
- for (@usbdisklist) { |
79 |
- next if /floppy/; |
80 |
- next if /cdrom/; |
81 |
- push @usbdisks, $_; |
82 |
- } |
83 |
- unless (scalar @usbdisks) { |
84 |
+ foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) { |
85 |
+ $udi =~ m/^(\S+)/; |
86 |
+ my $vollbl = qx(hal-get-property --udi $1 --key volume.label); |
87 |
+ $vollbl =~ m/^(\S+)/; |
88 |
+ if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';} |
89 |
+ push @usbdisks, lc($vollbl); |
90 |
+ } |
91 |
+ |
92 |
+ unless ($usbdisks[0]){ |
93 |
esmith::cgi::genResult( |
94 |
$fm->{cgi}, $fm->localise('ERR_NO_USB_DISK')); |
95 |
return |
96 |
@@ -3243,7 +3234,31 @@ |
97 |
elsif ($VFSType eq 'usb') |
98 |
{ |
99 |
$_[2] = "/" . $share; |
100 |
- return ( qx(/bin/mount "/$share" 2>&1) ); |
101 |
+ my $device = ""; |
102 |
+ my $blkdev = ""; |
103 |
+ my $vollbl = ""; |
104 |
+ foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) { |
105 |
+ $udi =~ m/^(\S+)/; |
106 |
+ my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted); |
107 |
+ |
108 |
+ if ($is_mounted eq "false\n") { |
109 |
+ $blkdev = qx(hal-get-property --udi $1 --key block.device); |
110 |
+ if ($blkdev =~ m/^(\S+)/) {$blkdev = $1;} |
111 |
+ } |
112 |
+ if ($is_mounted eq "false\n") { |
113 |
+ $vollbl = qx(hal-get-property --udi $1 --key volume.label); |
114 |
+ $vollbl =~ m/^(\S+)/; |
115 |
+ if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';} |
116 |
+ } |
117 |
+ |
118 |
+ chomp $vollbl; |
119 |
+ chomp $blkdev; |
120 |
+ $vollbl = lc("media/$vollbl"); |
121 |
+ if ($vollbl eq $share) { |
122 |
+ $device = $blkdev; |
123 |
+ } |
124 |
+ } |
125 |
+ return ( qx(/bin/mount $device "/$share" 2>&1) ); |
126 |
} |
127 |
else |
128 |
{ |