From 571b39343f6a51f585d890c2bc0e0f8ed5c4a92d Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 6 Aug 2009 18:43:55 +0000 Subject: [PATCH] read symlink destination istead of content --- lib/PXElator/client.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/PXElator/client.pm b/lib/PXElator/client.pm index 9000639..1c062f5 100644 --- a/lib/PXElator/client.pm +++ b/lib/PXElator/client.pm @@ -28,8 +28,13 @@ sub conf { write_file $path, $default; warn "default $path = $default"; $value = $default; - } else { - $value = read_file $path if -e $path; + } elsif ( -e $path ) { + if ( -l $path ) { + $value = readlink $path; + $value =~ s{.*/([^/]+)$}{$1}; + } else { + $value = read_file $path; + } } return $value; } -- 2.20.1