PDA

View Full Version : Determine Slim server version?



Victor Brilon
2006-10-15, 06:41
Any suggestions on how an external program can determine the current
version of the server running? Is there a module w/ a $VERSION I can
load up or anything similar?

Thanks,
Victor

Dan Sully
2006-10-15, 07:11
* Victor Brilon shaped the electrons to say...

>Any suggestions on how an external program can determine the current
>version of the server running? Is there a module w/ a $VERSION I can
>load up or anything similar?

brute force is probably the best way:

#!/usr/bin/perl -w

use strict;
use File::Slurp;

my @lines = read_file('slimserver.pl');
my $version = '';

for my $line (@lines) {

if ($line =~ /^\$VERSION\s+=\s+'(.+?)'/) {
$version = $1;
last;
}
}

print $version . "\n";


-D
--
Just because they're complaining doesn't mean they're right.

Victor Brilon
2006-10-15, 07:20
Yep, that's almost exactly how I am doing it now -- was hoping I
missed a more programatic way of doing it.

Thank Dan!

BTW, next time someone on these forums bitches about Slim's tech
support, they should count up how many posts come from you guys on
the weekend and other off hours :)

Victor

On Oct 15, 2006, at 9:11 AM, Dan Sully wrote:

> * Victor Brilon shaped the electrons to say...
>
>> Any suggestions on how an external program can determine the
>> current version of the server running? Is there a module w/ a
>> $VERSION I can load up or anything similar?
>
> brute force is probably the best way:
>
> #!/usr/bin/perl -w
>
> use strict;
> use File::Slurp;
>
> my @lines = read_file('slimserver.pl');
> my $version = '';
>
> for my $line (@lines) {
>
> if ($line =~ /^\$VERSION\s+=\s+'(.+?)'/) {
> $version = $1;
> last;
> }
> }
>
> print $version . "\n";
>
>
> -D
> --
> Just because they're complaining doesn't mean they're right.
>

mherger
2006-10-15, 11:59
> Any suggestions on how an external program can determine the current
> version of the server running? Is there a module w/ a $VERSION I can
> load up or anything similar?

A slightly more elegant way would be using the CLI's "version ?" command.

--

Michael

-----------------------------------------------------------------
http://www.herger.net/SlimCD - your SlimServer on a CD
http://www.herger.net/slim - AlbumReview, Biography, MusicInfoSCR