summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-07-26 03:36:58 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2015-07-26 03:36:58 (GMT)
commit530c0398afb0a90322d4436e93b378e22651fa5b (patch)
tree91b308e8996a76f747be231e25d7499368846e0d
parent816e4193f4b9d5f40267ebc569afef471b7f5786 (diff)
make excluded users configurable through command line options
-rwxr-xr-xutils/update-rd-tokens10
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) {