#!/usr/bin/perl
#
# Copyright 2001-2005 Daniel Klein, dan@klein.com.  All Rights Reserved.
#
# This program will read a version 2.x thermd.conf file (from
# /etc/thermd.conf or the argument) and write a new version to STDOUT
#

my $config_file = shift || "/etc/thermd.conf";

open CONF, $config_file	or die "Cannot read configuration file $config_file.\n";
while (<CONF>) {
    chomp;
    if (s/\\$//) {		# Handle continued lines
	my $continuation = <CONF>;
	$continuation =~ s/^\s+//;
	$_ .= $continuation;
	redo;
	}
    s#\b(show\+?\s+)([^/]+)/([\w.-]+)#$1$3\@$2#i;
    print "$_\n";;
    }
close CONF;
