X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ddef0d3170b1543e6ed580c7ce00849e3ed1550f..420381a226fbd0a19c8a0bc5125c572ab4ad775d:/ikiwiki-update-wikilist diff --git a/ikiwiki-update-wikilist b/ikiwiki-update-wikilist index 0b52543cd..2807e6be6 100755 --- a/ikiwiki-update-wikilist +++ b/ikiwiki-update-wikilist @@ -1,6 +1,7 @@ #!/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; @@ -30,6 +31,9 @@ while (<$list>) { $seen=1; push @lines, $_; } + else { + $changed=1; + } } else { push @lines, $_; @@ -45,7 +49,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"; }