#!/usr/bin/perl
# XXX: This might not be needed anymore
exit;

$config_file = "/etc/X11/fs/config";
$bkup_file = $config_file . ".ltsp.orig";
$tmp_file = $config_file . ".ltsp.tmp";

# don't bother to continue unless the target file exists
$exists = stat ($config_file);
if (! $exists) {
    print "\n". $config_file ." not found\n\n";
    exit;
}

# open target file
open (IN, "< $config_file");
open (OUT, "> $tmp_file");

$xdmcp_section = 0;
while (<IN>) {
    if ($_ =~ /^no-listen = tcp/i) {
        $_ = "#" . $_ ; 
    }
    print OUT $_;
}

# close up the files
close (IN);
close (OUT);

# out with the old, in with the new
`mv $config_file $bkup_file`;
`mv $tmp_file $config_file`;

exit;
