diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-08 17:41:28 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-08 17:41:28 +0200 |
commit | c298904d9d9a12281b368dd180f3e8b4f7aba898 (patch) | |
tree | 6dd4474240dadc06e81e7255add90c6ef90069b3 | |
parent | Fix (diff) | |
download | joe-scripts-c298904d9d9a12281b368dd180f3e8b4f7aba898.tar.gz joe-scripts-c298904d9d9a12281b368dd180f3e8b4f7aba898.tar.bz2 joe-scripts-c298904d9d9a12281b368dd180f3e8b4f7aba898.tar.xz joe-scripts-c298904d9d9a12281b368dd180f3e8b4f7aba898.tar.zst joe-scripts-c298904d9d9a12281b368dd180f3e8b4f7aba898.zip |
Tree update
-rw-r--r-- | README.org | 4 | ||||
-rwxr-xr-x | src/gitjoe/adduser.pl (renamed from src/gitjoe/newuser.pl) | 0 | ||||
-rwxr-xr-x | src/vps-do.pl | 25 |
3 files changed, 24 insertions, 5 deletions
@@ -17,10 +17,10 @@ The source tree is the following: └── src ├── gitjoe │ ├── addsshkey.pl + │ ├── adduser.pl │ ├── chdesc.pl │ ├── chowner.pl │ ├── newrepo.pl - │ ├── newuser.pl │ ├── rmrepo.pl │ └── rmuser.pl ├── other @@ -34,4 +34,4 @@ The source tree is the following: - ~gitjoe/~ scripts are meant to be run on the server directly. They are tools to add GitJoe users, repos, change descritpion, etc. - ~update/~ scripts are run via cron jobs. They update the GitJoe repositories front-end website via ~stagit~ and pull ~master~ branches of the websites via ~git~. - ~other/~ script is just a single line the start the ~git daemon~ to serve public repositories. -- The ~vps-do.pl~ script allows you to execute one of the distant scripts on your home terminal, opening and closing the ~ssh~ session for you. +- The ~vps-do.pl~ script allows you to execute one of the distant scripts from your home terminal, opening and closing the ~ssh~ session for you. You still need the ~dash~ shell as a dependency on your home terminal. diff --git a/src/gitjoe/newuser.pl b/src/gitjoe/adduser.pl index a141277..a141277 100755 --- a/src/gitjoe/newuser.pl +++ b/src/gitjoe/adduser.pl diff --git a/src/vps-do.pl b/src/vps-do.pl index 3c165c1..2ce11ff 100755 --- a/src/vps-do.pl +++ b/src/vps-do.pl @@ -18,10 +18,10 @@ sub main { my $ssh_boy = 'root@jozanleclerc.xyz'; if ( $ARGV[0] eq 'addsshkey' || + $ARGV[0] eq 'adduser' || $ARGV[0] eq 'chdesc' || $ARGV[0] eq 'chowner' || $ARGV[0] eq 'newrepo' || - $ARGV[0] eq 'newuser' || $ARGV[0] eq 'rmrepo' || $ARGV[0] eq 'rmuser' ) { @@ -40,17 +40,36 @@ sub main { . colored($ARGV[0], 'bold yellow') . ": unknown script. Known scripts are:\n" . colored("addsshkey\n", 'bold green') + . colored("adduser\n", 'bold green') . colored("chdesc\n", 'bold green') . colored("chowner\n", 'bold green') . colored("newrepo\n", 'bold green') - . colored("newuser\n", 'bold green') . colored("rmrepo\n", 'bold green') . colored("rmuser\n", 'bold green') . colored("update-gitjoe\n", 'bold green') . colored("update-vps\n", 'bold green'); exit 2; } - print "Calling " . colored($called_script, 'bold green') . " via " . colored($ssh_boy, 'bold') . "...\n"; + print "Calling " . colored($called_script, 'bold green') . " via " . colored($ssh_boy, 'bold magenta') . ".\n"; + if ($argc > 1) { + print "Arguments:\n"; + my $i = 1; + while ($i < $argc) { + print colored($ARGV[$i], 'bold yellow') . "\n"; + $i += 1; + } + } + my $dash = `/bin/sh -c "which dash"`; + chomp $dash; + system( + $dash, + '-c', + 'ssh ' . $ssh_boy . " << EOF 2>&1 +ls -lh +uname -n +exit +" + ); exit; } |