summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-11-27 16:57:07 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-11-27 16:57:07 +0100
commitd547adcfe40eacb4f43773a0be175e56f225b3fd (patch)
treed424bdca87d6f033aefabf9c76e704b7b2382e0e
parent7e4f9bcdb6027b667ce33c376e0de4bffe92755f (diff)
downloadbin-d547adcfe40eacb4f43773a0be175e56f225b3fd.tar.gz
bin-d547adcfe40eacb4f43773a0be175e56f225b3fd.tar.xz
restore.pl: ignore invalid selections
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-xrestore.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/restore.pl b/restore.pl
index 5e7214c..d553f06 100755
--- a/restore.pl
+++ b/restore.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#----------------------------------------------------
-# Version: 0.1.0
+# Version: 0.1.1
# Author: Florian "Bluewind" Pritz <flo@xssn.at>
#
# Licensed under WTFPL v2
@@ -69,7 +69,7 @@ for my $filename (@ARGV) {
print "\e[0;34mEnter ID to restore (Enter to skip): \e[0m";
my $id = <STDIN>;
chomp $id;
- next unless ($id =~ /^\d+$/);
+ next unless (exists ($filelist[$id]));
remove_tree $file if -d $file;
# need mtime preservation
#rcopy $filelist[$id]->{path}, $file;