1 |
diff -ruN e-smith-base-5.4.0.old/root/sbin/e-smith/console-menu-items/usbRestore.pl e-smith-base-5.4.0/root/sbin/e-smith/console-menu-items/usbRestore.pl |
2 |
--- e-smith-base-5.4.0.old/root/sbin/e-smith/console-menu-items/usbRestore.pl 1969-12-31 16:00:00.000000000 -0800 |
3 |
+++ e-smith-base-5.4.0/root/sbin/e-smith/console-menu-items/usbRestore.pl 2014-03-06 20:27:00.000000000 -0800 |
4 |
@@ -0,0 +1,3 @@ |
5 |
+package esmith::console::perform_restore; |
6 |
+use esmith::console::perform_restore; |
7 |
+return new esmith::console::perform_restore; |
8 |
diff -ruN e-smith-base-5.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console/perform_restore.pm e-smith-base-5.4.0/root/usr/share/perl5/vendor_perl/esmith/console/perform_restore.pm |
9 |
--- e-smith-base-5.4.0.old/root/usr/share/perl5/vendor_perl/esmith/console/perform_restore.pm 2014-03-06 20:19:15.000000000 -0800 |
10 |
+++ e-smith-base-5.4.0/root/usr/share/perl5/vendor_perl/esmith/console/perform_restore.pm 2014-03-06 21:05:43.000000000 -0800 |
11 |
@@ -8,15 +8,28 @@ |
12 |
sub new |
13 |
{ |
14 |
my $class = shift; |
15 |
- my $self = {}; |
16 |
+ my $self = { |
17 |
+ name => gettext("Perform restore from removable media"), |
18 |
+ order => installOrder(), |
19 |
+ }; |
20 |
bless $self, $class; |
21 |
return $self; |
22 |
} |
23 |
|
24 |
+ |
25 |
+sub name |
26 |
+{ |
27 |
+ return $_[0]->{name}; |
28 |
+} |
29 |
+ |
30 |
+sub order |
31 |
+{ |
32 |
+ return $_[0]->{order}; |
33 |
+} |
34 |
+ |
35 |
sub doit |
36 |
{ |
37 |
my ($self, $console, $db) = @_; |
38 |
- return if ($db->get_value('PasswordSet') eq 'yes'); # Too late to do a restore |
39 |
my ($rc, $choice) = $console->yesno_page |
40 |
( |
41 |
title => gettext("Restore From Backup"), |
42 |
@@ -132,6 +145,15 @@ |
43 |
system("/sbin/e-smith/signal-event", "post-upgrade"); |
44 |
} |
45 |
|
46 |
+# Determine if this server is a fresh install for restore from backup |
47 |
+sub installOrder |
48 |
+{ |
49 |
+#my $db = esmith::ConfigDB::unsaved->open; |
50 |
+#return if ($db->get_value('PasswordSet') eq 'yes'); # Too late to do a restore |
51 |
+ my $order = (`grep :x:5...: /etc/group`) ? -1 : 90; |
52 |
+ return $order; |
53 |
+} |
54 |
+ |
55 |
#use esmith::console; |
56 |
#esmith::console::perform_restore->new->doit(esmith::console->new, |
57 |
# esmith::ConfigDB->open); |