aboutsummaryrefslogtreecommitdiffstats
path: root/gitjoe-newuser.pl
diff options
context:
space:
mode:
Diffstat (limited to 'gitjoe-newuser.pl')
-rwxr-xr-xgitjoe-newuser.pl12
1 files changed, 10 insertions, 2 deletions
diff --git a/gitjoe-newuser.pl b/gitjoe-newuser.pl
index 471dd94..0a6a0e8 100755
--- a/gitjoe-newuser.pl
+++ b/gitjoe-newuser.pl
@@ -6,15 +6,16 @@ use Term::ANSIColor;
sub main {
my $argc = $#ARGV + 1;
- if ($argc < 2) {
+ if ($argc < 3) {
print colored("Failed!\n", 'bold red')
. "Missing argument, 2 needed "
- . colored("[user - password]", 'bold')
+ . colored("[user - password - ssh public key]", 'bold')
. "\n";
exit 1;
}
my $usr = $ARGV[0];
my $pass = $ARGV[1];
+ my $home_dir = '/usr/home/' . $usr . '/';
system(
'/usr/local/bin/dash',
'-c',
@@ -38,6 +39,13 @@ yes
no
EOF"
);
+ my $gitshell_cmds = "cd
+touch
+git
+ls";
+ open(my $fh, '>:encoding(UTF-8)', $home_dir . 'git-shell-commands');
+ print $fh $gitshell_cmds;
+ close($fh);
}
main();