From 7b33585405d285c5db1c88eaea06e5ae983dd0b2 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sun, 13 Mar 2022 10:48:03 +0100 Subject: [PATCH] matrix-commander - run as current user --- seqs/matrix-commander.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/seqs/matrix-commander.sh b/seqs/matrix-commander.sh index e4ca18f..6e5cab9 100755 --- a/seqs/matrix-commander.sh +++ b/seqs/matrix-commander.sh @@ -38,11 +38,13 @@ step_config() { return 0 } -step_1_info() { echo "Run $toolName"; } +step_1_info() { echoinfoArgs "[-u]"; echo "Run $toolName"; } step_1_alias() { ALIAS="run"; } step_1() { shift - exe sudo -u $MACO_USER "$MACO_BASE_DIR/bin/python3" "$MACO_DIR/matrix-commander.py" "$@" + local asUser= + [ "$1" == "-u" ] && asUser="sudo -u $MACO_USER" && shift + exe $asUser "$MACO_BASE_DIR/bin/python3" "$MACO_DIR/matrix-commander.py" "$@" } step_3_info() { @@ -67,7 +69,7 @@ step_51() { id $MACO_USER >/dev/null 2>&1 [ $? -eq 0 ] && endReturn -o 1 "User $MACO_USER already exists" - exe adduser --system $MACO_USER --group --home "${MACO_BASE_DIR}" + exe adduser --system $MACO_USER --group --home "${MACO_BASE_DIR}" --no-create-home } step_52_info() { echo "Create venv and install $toolName"; }