summaryrefslogtreecommitdiff
path: root/pinyadmin/sbin
diff options
context:
space:
mode:
Diffstat (limited to 'pinyadmin/sbin')
-rwxr-xr-xpinyadmin/sbin/rebuildrepo7
1 files changed, 7 insertions, 0 deletions
diff --git a/pinyadmin/sbin/rebuildrepo b/pinyadmin/sbin/rebuildrepo
index 9d4e359..2ddc33b 100755
--- a/pinyadmin/sbin/rebuildrepo
+++ b/pinyadmin/sbin/rebuildrepo
@@ -5,10 +5,17 @@ use warnings;
use Piny;
+my $env = Piny::Environment->instance( );
+
foreach my $reponame ( @ARGV ) {
my $repo = Piny::Repo->new( $reponame );
+ if ( $env->user->uid != 0 and $repo->owner->uid != $env->user->uid ) {
+ print STDERR "You are not the owner of $reponame!\n";
+ exit 1;
+ };
+
$repo->rebuild;
};