Petrb has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/62349


Change subject: some more tools to git
......................................................................

some more tools to git

Change-Id: Icc0094d8aba34c571d930eafd79904f748e10ad7
---
A usr/local/bin/become
1 file changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs 
refs/changes/49/62349/1

diff --git a/usr/local/bin/become b/usr/local/bin/become
new file mode 100755
index 0000000..eab5657
--- /dev/null
+++ b/usr/local/bin/become
@@ -0,0 +1,21 @@
+#! /bin/bash
+
+
+if [ $# -lt 1 ]; then
+  echo "usage: $(basename $0) <toolname> [command [args...]]" >&2
+  exit 1
+fi
+if ! id "local-$1" >/dev/null 2>&1
+then
+  echo "$(basename $0): no such tool '$1'" >&2
+  exit 1
+fi
+if ! [ -d "/data/project/$1" ]
+then
+  echo "$(basename $0): no such tool '$1'" >&2
+  exit 1
+fi
+user="$1"
+shift
+exec /usr/bin/sudo -niu "local-$user" "$@"
+

-- 
To view, visit https://gerrit.wikimedia.org/r/62349
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc0094d8aba34c571d930eafd79904f748e10ad7
Gerrit-PatchSet: 1
Gerrit-Project: labs/toollabs
Gerrit-Branch: master
Gerrit-Owner: Petrb <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to