matrix-commander - Finalized for manual installation
This commit is contained in:
@@ -3,3 +3,23 @@
|
||||
MACO_USER="matrixcommander"
|
||||
MACO_BASE_DIR="/opt/matrix-commander"
|
||||
MACO_DIR="$MACO_BASE_DIR/matrix-commander"
|
||||
MACO_SERVICE="[Unit]
|
||||
Description=Matrix-Commander
|
||||
After=syslog.target network-online.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
User=$MACO_USER
|
||||
Group=$MACO_USER
|
||||
|
||||
Type=simple
|
||||
|
||||
ExecStart=${MACO_BASE_DIR}/bin/python3 ${MACO_DIR}/matrix-commander.py --listen forever --listen-self
|
||||
TimeoutStopSec=20
|
||||
#KillMode=process
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Alias=matrix-commander.service"
|
||||
|
@@ -36,14 +36,19 @@ step_config() {
|
||||
}
|
||||
|
||||
|
||||
step_1_info() { echo "Add system user"; }
|
||||
step_1_info() { echo "Install $toolName dependencies"; }
|
||||
step_1_alias() { ALIAS="install"; }
|
||||
step_1() {
|
||||
exe adduser --system $MACO_USER --group --home "${MACO_BASE_DIR}"
|
||||
apt install $toolDeps $APTOPT
|
||||
}
|
||||
|
||||
step_2_info() { echo "Create venv and install $toolName"; }
|
||||
step_2_info() { echo "Add system user $MACO_USER"; }
|
||||
step_2() {
|
||||
exe adduser --system $MACO_USER --group --home "${MACO_BASE_DIR}"
|
||||
}
|
||||
|
||||
step_3_info() { echo "Create venv and install $toolName"; }
|
||||
step_3() {
|
||||
local macommanderDir="${MACO_DIR}"
|
||||
|
||||
exe python3 -m venv "$toolVenvDir"
|
||||
@@ -54,8 +59,8 @@ step_2() {
|
||||
exe sudo -u $MACO_USER ${toolVenvDir}/bin/pip install --upgrade pip
|
||||
}
|
||||
|
||||
step_3_info() { echo "Install python requirements"; }
|
||||
step_3() {
|
||||
step_4_info() { echo "Install python requirements"; }
|
||||
step_4() {
|
||||
cat <<NOTES_END
|
||||
# Remove following packages for headless servers
|
||||
|
||||
@@ -68,33 +73,20 @@ NOTES_END
|
||||
}
|
||||
|
||||
|
||||
step_4_info() { echo "Create systemd service for $toolName"; }
|
||||
step_4() {
|
||||
step_6_info() { echo "Create systemd service for $toolName"; }
|
||||
step_6_alias() { ALIAS="service"; }
|
||||
step_6() {
|
||||
local macommanderServiceLoc="/etc/systemd/system/matrix-commander.service"
|
||||
local lService=$(eval "echo \"$macommanderService\"")
|
||||
addConf -s "$lService" "$macommanderServiceLoc"
|
||||
addConf -s "$MACO_SERVICE" "$macommanderServiceLoc"
|
||||
exe systemctl daemon-reload
|
||||
}
|
||||
macommanderService="[Unit]
|
||||
Description=Matrix-Commander
|
||||
After=syslog.target network-online.target
|
||||
StartLimitIntervalSec=0
|
||||
|
||||
[Service]
|
||||
User=\$MACO_USER
|
||||
Group=\$MACO_USER
|
||||
|
||||
Type=simple
|
||||
|
||||
ExecStart=\${toolVenvDir}/bin/python3 \${MACO_DIR}/matrix-commander.py
|
||||
TimeoutStopSec=20
|
||||
#KillMode=process
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Alias=matrix-commander.service"
|
||||
step_10_info() { echo "Run $toolName"; }
|
||||
step_10_alias() { ALIAS="run"; }
|
||||
step_10() {
|
||||
shift
|
||||
exe sudo -u $MACO_USER "$toolVenvDir/bin/python3" "$MACO_DIR/matrix-commander.py" "$@"
|
||||
}
|
||||
|
||||
VERSION_SEQREV=15
|
||||
. /usr/local/bin/sequencer.sh
|
||||
|
Reference in New Issue
Block a user