From 530c0398afb0a90322d4436e93b378e22651fa5b Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 26 Jul 2015 05:36:58 +0200 Subject: make excluded users configurable through command line options diff --git a/utils/update-rd-tokens b/utils/update-rd-tokens index 1aee501..bcd5bb1 100755 --- a/utils/update-rd-tokens +++ b/utils/update-rd-tokens @@ -24,13 +24,19 @@ use strict; use RHRD::rddb; use String::MkPasswd qw(mkpasswd); -# this is ridiculous but makes it a little harder to find user passwords... +# this is ridiculous but makes it a little harder to change user passwords... if ($> != 0 ) { print STDERR "this must be run as root!\n"; exit 1; } -my %EXCLUDED_USERS = ('admin' => 1, 'importer' => 1, 'player' => 1); +my $num_args = $#ARGV + 1; +if ($num_args <= 0) { + print STDERR "WARNING: this will update all users tokens (except for admin)\n"; +} + +my %EXCLUDED_USERS = map { $_ => 1 } @ARGV; +$EXCLUDED_USERS{'admin'} = 1; my ($dbh, undef, $errorstring) = RHRD::rddb::opendb(); if(defined $dbh) { -- cgit v0.10.2