1 |
diff -Nur e-smith-backup-2.4.0.bz9090.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup e-smith-backup-2.4.0.bz9090.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup |
2 |
--- e-smith-backup-2.4.0.bz9090.old/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup 2015-10-11 21:55:16.705468622 +0200 |
3 |
+++ e-smith-backup-2.4.0.bz9090.new/root/etc/e-smith/locale/en-us/etc/e-smith/web/functions/backup 2015-10-29 22:56:34.807907323 +0100 |
4 |
@@ -928,5 +928,8 @@ |
5 |
<base>Mounted disk</base> |
6 |
<trans>Mounted disk</trans> |
7 |
</entry> |
8 |
- </lexicon> |
9 |
- |
10 |
+ <entry> |
11 |
+ <base>ERROR_WHEN_TESTING_REMOTE_SERVER</base> |
12 |
+ <trans>The parameters have been saved, however the remote host is not reachable, please check your settings.</trans> |
13 |
+ </entry> |
14 |
+</lexicon> |
15 |
diff -Nur e-smith-backup-2.4.0.bz9090.old/root/etc/e-smith/web/functions/backup e-smith-backup-2.4.0.bz9090.new/root/etc/e-smith/web/functions/backup |
16 |
--- e-smith-backup-2.4.0.bz9090.old/root/etc/e-smith/web/functions/backup 2015-10-11 21:55:16.741473836 +0200 |
17 |
+++ e-smith-backup-2.4.0.bz9090.new/root/etc/e-smith/web/functions/backup 2015-10-15 23:47:28.040059646 +0200 |
18 |
@@ -1729,6 +1729,21 @@ |
19 |
system("/sbin/e-smith/signal-event", "conf-backup") == 0 |
20 |
or die($fm->localise('ERR_CONF_BACKUP'),"\n"); |
21 |
|
22 |
+ # we test if the remote host is reachable, else we simply display a warning |
23 |
+ if ( $VFSType =~ m/cifs|nfs/s ) |
24 |
+ { |
25 |
+ my $error_message = vmount($backupwkStation,$backupwkFolder,$backupwkMount,$VFSType); |
26 |
+ if (! $error_message) |
27 |
+ { |
28 |
+ bunmount($backupwkMount,$VFSType); |
29 |
+ } |
30 |
+ elsif ($error_message) |
31 |
+ { |
32 |
+ esmith::cgi::genResult($q, $fm->localise('ERROR_WHEN_TESTING_REMOTE_SERVER').$q->br() . "$error_message"); |
33 |
+ return; |
34 |
+ } |
35 |
+ } |
36 |
+ |
37 |
esmith::cgi::genResult( |
38 |
$q, $fm->localise('SUCCESSFULLY_ENABLED_WORKSTN').$q->br(). |
39 |
$fm->localise('WITH_BACKUP_TIME')."$backupwkHour:$backupwkMin"); |
40 |
@@ -3217,6 +3232,23 @@ |
41 |
return; |
42 |
} |
43 |
|
44 |
+#Used to test if the remote share is mountable when you save settings in database |
45 |
+sub vmount |
46 |
+{ |
47 |
+ # mount dar unit according to dar-workstation configuration in order to test the remote host |
48 |
+ # return nothing if mount successfull |
49 |
+ my ($host,$share,$mountdir,$VFSType) = @_; |
50 |
+ if ($VFSType eq 'cifs') |
51 |
+ { |
52 |
+ return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) ); |
53 |
+ } |
54 |
+ elsif ($VFSType eq 'nfs') |
55 |
+ { |
56 |
+ return ( qx(/bin/mount -t nfs -o nolock,timeo=30,retrans=1,retry=0 "$host:/$share" $mountdir 2>&1) ); |
57 |
+ } |
58 |
+ |
59 |
+} |
60 |
+ |
61 |
__DATA__ |
62 |
<form> |
63 |
</form> |
64 |
|