aboutsummaryrefslogtreecommitdiffstats
path: root/gitjoe-newuser.pl
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 16:33:36 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 16:33:36 +0200
commit1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9 (patch)
treef750c840bf2e20b2cd1accb6e8e0019c307752a5 /gitjoe-newuser.pl
downloadjoe-scripts-1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9.tar.gz
joe-scripts-1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9.tar.bz2
joe-scripts-1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9.tar.xz
joe-scripts-1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9.tar.zst
joe-scripts-1f7a8e437f2029e0a5a2ddb5006f8b706e618dc9.zip
First commit
Diffstat (limited to 'gitjoe-newuser.pl')
-rwxr-xr-xgitjoe-newuser.pl35
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__