diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-10-08 23:54:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-10-08 23:54:53 +0200 |
commit | 2394fdf12cba7b2bd03e4d5810e627cfab5b7308 (patch) | |
tree | 55c72bc26cfcbef8c2d1a35620e62789ed2f57af | |
parent | 0ac96538b643238de0b99db7640e1c3ab18c4c06 (diff) |
bin/checklinks: Allow 'links' as well as '.links'
-rwxr-xr-x | bin/checklinks | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bin/checklinks b/bin/checklinks index fc67f3b..79ab334 100755 --- a/bin/checklinks +++ b/bin/checklinks @@ -7,9 +7,14 @@ my $base = $ENV{HOME}; my ($type, $src, $dst); my $quiet = 0; my $remove = 0; - -unless (-f ".links") { - exit 0; +my $linkfile; + +if (-f '.links') { + $linkfile = '.links'; +} elsif (-f 'links') { + $linkfile = 'links'; +} else { + exit(0); } if (defined($ARGV[0])) { @@ -21,7 +26,7 @@ if (defined($ARGV[0])) { } } -open(LINKS, '<.links') or die($!); +open(LINKS, '<', $linkfile) or die($!); while(<LINKS>) { chomp; ($type, $src, $dst) = split; |