File: script_server.pl

package info (click to toggle)
cacti 0.8.8b%2Bdfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 9,796 kB
  • sloc: php: 52,273; sql: 2,463; xml: 691; sh: 434; perl: 151; makefile: 30
file content (19 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
chdir("./scripts");
$loaded = 0;
while ($file = <*.pl>) {
	next if $file eq $0;
	eval 'require $file';
	$loaded++;
}
print "Loading complete ($loaded files loaded)\r\n";
while ($in = <STDIN>) {
	if ($in eq "quit\r\n") {
		print "Exiting\r\n";
		exit;
	} elsif ($in =~ /^([^\s]+) (.+)\r\n$/) {
		eval {
			$out = &{$1}($2);
		};
		print "$out\r\n";
	}
}