#!/usr/bin/perl
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
#  
#  
# Licensed Materials - Property of IBM 
#  
# (C) COPYRIGHT International Business Machines Corp. 2004,2007 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 

# lssrtfs - list system registry table files
#
# Usage: sr_lstfs
#
# Lists all system registry table files for all cluster id's,
# calling sr_lsfds for each table file.  Output for each table file
# is as follows:
#
# TABLE <table_path>:
# sr_lsfds <table_path> results

open(REGISTRIES, "/usr/sbin/rsct/bin/lsclcfg -ax -D' ' |");

while (<REGISTRIES>)
{
	# id is cluster name
	# name is the symbolic link to /var/ct/$id

	($name, $id) = split;

	$local_tree = "/var/ct/" . $name . "/registry/local_tree";

	opendir(LOCAL_TREE, $local_tree);

	while ($table_file = readdir LOCAL_TREE)
	{
		if (!(($table_file eq ".") | ($table_file eq "..")))
		{
			$table_file_path = $local_tree . "/" . $table_file;
			printf("TABLE %s:\n", $table_file_path);
			system("/usr/sbin/rsct/bin/sr_lsfds $table_file_path");
			printf("\n");
		}
	}
}
