File: mkconf.pl

package info (click to toggle)
powerman 2.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 3,520 kB
  • ctags: 2,013
  • sloc: ansic: 14,102; sh: 10,556; yacc: 641; lex: 271; makefile: 234; perl: 11
file content (19 lines) | stat: -rwxr-xr-x 417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
#
# Usage: mkconf.pl plugcount 
#
# Builds a powerman.conf file for a vpc config for plugcount plugs.

$maxnodes = $ARGV[0];
$nodespervpc = 16;
$devs = $maxnodes / $nodespervpc;

print "include \"vpc.dev\"\n";
for ($i = 0; $i < $devs; $i++) {
	$m = $i * $nodespervpc;
	$n = $m + $nodespervpc - 1;
	print "device \"test$i\" \"vpc\" \"./vpcd |&\"\n";
	print "node \"t[$m-$n]\" \"test$i\"\n";
}

exit 0;