aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 16:44:02 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-07-06 16:44:02 +0200
commit60caba003b052a13b7d6fbc942f7b0139ef955fd (patch)
tree9f8273cf3bb2a4dce1de55e479b6acbe0c23ccff
parentFirst commit (diff)
downloadjoe-scripts-60caba003b052a13b7d6fbc942f7b0139ef955fd.tar.gz
joe-scripts-60caba003b052a13b7d6fbc942f7b0139ef955fd.tar.bz2
joe-scripts-60caba003b052a13b7d6fbc942f7b0139ef955fd.tar.xz
joe-scripts-60caba003b052a13b7d6fbc942f7b0139ef955fd.tar.zst
joe-scripts-60caba003b052a13b7d6fbc942f7b0139ef955fd.zip
Added some scripts
-rwxr-xr-xgitjoe-newuser.pl12
-rw-r--r--gitjoe-rmuser.pl28
-rwxr-xr-xupdate-site.sh4
3 files changed, 41 insertions, 3 deletions
diff --git a/gitjoe-newuser.pl b/gitjoe-newuser.pl
index d17c477..471dd94 100755
--- a/gitjoe-newuser.pl
+++ b/gitjoe-newuser.pl
@@ -14,11 +14,12 @@ sub main {
exit 1;
}
my $usr = $ARGV[0];
+ my $pass = $ARGV[1];
system(
'/usr/local/bin/dash',
'-c',
"adduser << EOF
-". $usr . "
+" . $usr . "
@@ -26,6 +27,15 @@ sub main {
git-shell
+
+
+
+
+" . $pass . "
+" . $pass . "
+
+yes
+no
EOF"
);
}
diff --git a/gitjoe-rmuser.pl b/gitjoe-rmuser.pl
new file mode 100644
index 0000000..f84dbc6
--- /dev/null
+++ b/gitjoe-rmuser.pl
@@ -0,0 +1,28 @@
+#!/usr/local/bin/perl
+
+use strict;
+use warnings;
+use Term::ANSIColor;
+
+sub main {
+ my $argc = $#ARGV + 1;
+ if ($argc < 1) {
+ print colored("Failed!\n", 'bold red')
+ . "Missing argument, 1 needed "
+ . colored("[user]", 'bold')
+ . "\n";
+ exit 1;
+ }
+ my $usr = $ARGV[0];
+ system(
+ '/usr/local/bin/dash',
+ '-c',
+ "rmuser << EOF
+" . $usr . "
+y
+y
+EOF"
+ );
+}
+
+main();
diff --git a/update-site.sh b/update-site.sh
index 8dea1db..57b9e34 100755
--- a/update-site.sh
+++ b/update-site.sh
@@ -1,5 +1,5 @@
#!/usr/local/bin/dash
-cd /usr/local/www/jozan || exit 1
-git pull
+git -C /usr/local/www/jozan pull
+git -C /root/scripts pull
exit