#!/usr/bin/perl

########################################################################
#
# pmall Ver 2.1 beta2
#
# Portmaster   : ComOS 3.3.1
# Description  : execute a command from stdin on @All your pormasters
#
# usage: echo "show global" | pmall
#
#######################################################################

require 'pm.pl';
$Pass = $ARGV[0] || $Password;

@Commands = <STDIN>;

foreach $host (@All) {
  print "Host: $host\n";
  portmaster::Connect("$host", "$Pass");
  foreach (@Commands) {
     s/[\r\n]//g;

     print "$host> $_\n";
     &portmaster::Command($_);
  }
  close(portmaster::DS);

}
