#!/usr/bin/perl -t
# Add a user to the system wide wikilist.
-# This script can safely be made suid.
+# This script can safely be made suid or put in /etc/sudoers.
+no lib '.';
use warnings;
use strict;
use English;
$seen=1;
push @lines, $_;
}
+ else {
+ $changed=1;
+ }
}
else {
push @lines, $_;
}
if ($changed) {
close $list || die "ikiwiki-update-wikilist: error reading $list: $!\n";
- open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: error writing $wikilist: $!\n";
+ open ($list, ">$wikilist") || die "ikiwiki-update-wikilist: cannot write to $wikilist\n";
foreach (@lines) {
print $list "$_\n";
}