3 # This script creates a new newsgroup.
6 if( !($0 =~ /\/scripts\/create-newsgroup\.pl$/) ) {
7 die "This script can only be called with full path name!!!";
11 $webstump_home =~ s/\/scripts\/create-newsgroup\.pl$//;
13 require "$webstump_home/config/webstump.cfg";
14 require "$webstump_home/scripts/webstump.lib.pl";
18 $newsgroup = @ARGV[0];
22 print "Creating newsgroup:
24 Approval Address: $address
25 Admin password: $password
26 Press ENTER to continue, ^C to interrupt:\n";
30 print "Adding $newsgroup to $webstump_home/config/newsgroups.lst...";
31 &append_to_file( "$webstump_home/config/newsgroups.lst",
32 "$newsgroup $address\n" );
33 mkdir "$webstump_home/queues/$newsgroup", 0755;
34 print "
\b\b\b done.\n";
36 $dir = "$webstump_home/config/newsgroups/$newsgroup";
38 print "Creating $dir...";
40 print "
\b\b\b done.\n";
42 print "Creating files in $dir...";
44 &append_to_file( "$dir/blacklist", "" );
45 &append_to_file( "$dir/moderators", "ADMIN \U$password\n" );
46 &append_to_file( "$dir/rejection-reasons",
47 "offtopic::a blatantly offtopic article, spam
48 harassing::message of harassing content
49 charter::message poorly formatted
51 &append_to_file( "$dir/whitelist", "" );
52 print "
\b\b\b done.\n";