diff options
author | Florian Pritz <bluewind@xssn.at> | 2010-11-27 16:57:07 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2010-11-27 16:57:07 +0100 |
commit | d547adcfe40eacb4f43773a0be175e56f225b3fd (patch) | |
tree | d424bdca87d6f033aefabf9c76e704b7b2382e0e | |
parent | 7e4f9bcdb6027b667ce33c376e0de4bffe92755f (diff) | |
download | bin-d547adcfe40eacb4f43773a0be175e56f225b3fd.tar.gz bin-d547adcfe40eacb4f43773a0be175e56f225b3fd.tar.xz |
restore.pl: ignore invalid selections
Signed-off-by: Florian Pritz <bluewind@xssn.at>
-rwxr-xr-x | restore.pl | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |