#!/usr/local/bin/perl
# cachemgr.cgi
# Run the squid cachemgr.cgi program

require './squid-lib.pl';
$access{'cms'} || &error($text{'cach_ecannot'});
$mgr = $config{'cachemgr_path'};
if (&has_command($mgr)) {
	$| = 1;
	open(MGR, "$mgr ".join(" ", @ARGV)." |");
	while(<MGR>) {
		print;
		}
	close(MGR);
	}
else {
	&header($text{'cach_err'}, "");
	print "<hr>\n";
	print &text('cach_nfound',$mgr,$module_name);
	print "\n<p>\n";
	}
print "<hr>\n";
&footer("", $text{'cach_return'});

