matrix-commander - run as current user

This commit is contained in:
2022-03-13 10:48:03 +01:00
parent 729f4923f9
commit 7b33585405

View File

@@ -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"; }