#!/usr/bin/perl5.00503

# bin/dns-chk.sara
#
# Last Mod 8 Mar 99, 23:30:00 by Bob Todd
#
require 'config/paths.pl';
require 'config/sara.cf';
require 'perl/misc.pl';
require 'perllib/getopts.pl';
sub get_plugin {
  my  $pi_dir = "plugins";
  my $enabled = '';
  @_list = `ls $pi_dir/*.pi 2>/dev/null`;
  for (@_list) {
    chomp;
    $_file = $_;
    $_results = `grep '^\$pi_mode' $_`;
    $_results =~ s/\$pi_mode//;
    $_results =~ s/\n//;
    $_results =~ s/\"//g;
    $_results =~ s/\=//;
    $_results =~ s/\;//;
    $_results =~ s/ //g;
    $_file =~ s/$pi_dir\///;
    if ($_results eq "enabled" &&  $enabled ne "enabled" ) {
      return "$_file";
      $enabled = "enabled";
    }else {
      return;
    }
  }
}
