diff --git a/seqs/matrix-commander.sh b/seqs/matrix-commander.sh index b097e6f..e4ca18f 100755 --- a/seqs/matrix-commander.sh +++ b/seqs/matrix-commander.sh @@ -38,23 +38,40 @@ step_config() { return 0 } - -step_1_info() { echo "Install $toolName dependencies"; } -step_1_alias() { ALIAS="install"; } +step_1_info() { 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" "$@" +} + +step_3_info() { + echoinfoArgs "[MESSAGE] [MESSAGE] ..." + echo "Send message" + echoinfo "Each string ([MESSAGE]) is send as separate message" +} +step_3_alias() { ALIAS="message"; } +step_3() { + shift + step run -m "$@" +} + +step_50_info() { echo "Install $toolName dependencies"; } +step_50_alias() { ALIAS="install"; } +step_50() { apt install $toolDeps $APTOPT } -step_2_info() { echo "Add system user $MACO_USER"; } -step_2() { +step_51_info() { echo "Add system user $MACO_USER"; } +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}" } -step_3_info() { echo "Create venv and install $toolName"; } -step_3() { +step_52_info() { echo "Create venv and install $toolName"; } +step_52() { [ -e "$MACO_BASE_DIR" ] && endReturn -o 1 "$toolName already installed" exe python3 -m venv "$MACO_BASE_DIR" @@ -65,8 +82,8 @@ step_3() { exe sudo -u $MACO_USER ${MACO_BASE_DIR}/bin/pip install --upgrade pip } -step_4_info() { echo "Install python requirements"; } -step_4() { +step_53_info() { echo "Install python requirements"; } +step_53() { cat <