X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/bc3363beb767a82e3bdde2d038e7b678bd35f193..fb2e00014da40d677f79b6b07e05ae821e7e10e5:/ikiwiki-update-wikilist diff --git a/ikiwiki-update-wikilist b/ikiwiki-update-wikilist index 0b52543cd..56d6e0731 100755 --- a/ikiwiki-update-wikilist +++ b/ikiwiki-update-wikilist @@ -1,6 +1,6 @@ #!/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. use warnings; use strict; use English; @@ -30,6 +30,9 @@ while (<$list>) { $seen=1; push @lines, $_; } + else { + $changed=1; + } } else { push @lines, $_; @@ -45,7 +48,7 @@ if (! $seen && ! $remove) { } 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"; }