summaryrefslogtreecommitdiff
path: root/bin/checklinks
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-10-08 23:54:53 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-10-08 23:54:53 +0200
commit2394fdf12cba7b2bd03e4d5810e627cfab5b7308 (patch)
tree55c72bc26cfcbef8c2d1a35620e62789ed2f57af /bin/checklinks
parent0ac96538b643238de0b99db7640e1c3ab18c4c06 (diff)
bin/checklinks: Allow 'links' as well as '.links'
Diffstat (limited to 'bin/checklinks')
-rwxr-xr-xbin/checklinks13
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;