diff options
-rwxr-xr-x | utils/update-rd-tokens | 10 |
1 files changed, 8 insertions, 2 deletions
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) { |