diff options
Diffstat (limited to 'gitjoe-newuser.pl')
-rwxr-xr-x | gitjoe-newuser.pl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gitjoe-newuser.pl b/gitjoe-newuser.pl new file mode 100755 index 0000000..d17c477 --- /dev/null +++ b/gitjoe-newuser.pl @@ -0,0 +1,35 @@ +#!/usr/local/bin/perl + +use strict; +use warnings; +use Term::ANSIColor; + +sub main { + my $argc = $#ARGV + 1; + if ($argc < 2) { + print colored("Failed!\n", 'bold red') + . "Missing argument, 2 needed " + . colored("[user - password]", 'bold') + . "\n"; + exit 1; + } + my $usr = $ARGV[0]; + system( + '/usr/local/bin/dash', + '-c', + "adduser << EOF +". $usr . " + + + + + +git-shell + +EOF" + ); +} + +main(); + +__END__ |