Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 26c27513bb
Fetching contributors…

Cannot retrieve contributors at this time

executable file 34 lines (25 sloc) 0.626 kB
#!/usr/local/bin/perl -w
use strict;
use warnings;
use Chisel::SanityCheck qw/:all/;
my %files = args();
check_files(
files => \%files,
min => [qw/ MAIN /],
max => [qw/ MAIN /],
);
my @contents = split "\n", read_file( filename => $files{MAIN} );
# maximum length is 2KB (no real reason for it to ever be larger)
if( length $files{'MAIN'} > 2048 ) {
die "'service' file is too long\n";
}
# the file will look like:
# snmpd on
# sshd on
# pushsshd off
foreach my $line (@contents) {
if( $line !~ /^\s*(\w+)\s+(on|off)\s*$/ ) {
die "invalid 'service' file line: $line\n";
}
}
exit 0;
Jump to Line
Something went wrong with that request. Please try again.