diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-06 17:00:42 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-06 17:00:42 +0200 |
commit | 084fe5456637f17a698dc29c408df31758356a90 (patch) | |
tree | 4228793f3f683397aa04ddc303bb134b5b4c8392 /gitjoe-newuser.pl | |
parent | Chmodded +x rmuser (diff) | |
download | joe-scripts-084fe5456637f17a698dc29c408df31758356a90.tar.gz joe-scripts-084fe5456637f17a698dc29c408df31758356a90.tar.bz2 joe-scripts-084fe5456637f17a698dc29c408df31758356a90.tar.xz joe-scripts-084fe5456637f17a698dc29c408df31758356a90.tar.zst joe-scripts-084fe5456637f17a698dc29c408df31758356a90.zip |
Trying git shell cmd
Diffstat (limited to 'gitjoe-newuser.pl')
-rwxr-xr-x | gitjoe-newuser.pl | 12 |
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(); |