#!/store/bin/perl5
#
# Author: Petter Reinholdtsen <pere@td.org.uit.no>
# Date:   1999-04-15
#
# Parse Store nigthly output, and generate list of ssh/rsh commands to
# fix suid/sgid changes.

$lasthost = "";
while (<>) {
  chomp;
  if (/^\(Info\)  =+ OUTPUT FROM cslave @ (\S+) =+/) {
    $host = $1;
  } 
  if (/^ ch(own|grp|mod)/) {
    if ($lasthost ne $host) {
      $lasthost = $host;
      print "\n";
      print "ssh $host $_";
    } else {
      print "\\;$_";
    }
  }
}
