File: script_server.pl

package info (click to toggle)
cacti 0.8.8h%2Bds1-10%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,760 kB
  • sloc: php: 35,105; sql: 2,408; xml: 719; sh: 433; perl: 152; makefile: 31
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";
	}
}