Used sequpgrade.sh to upgrade existing seqs

This commit is contained in:
2022-05-29 20:58:23 +02:00
parent 10ee4198f0
commit 6214493c18
57 changed files with 802 additions and 806 deletions

View File

@@ -17,7 +17,7 @@ SCRIPT_NAME=${SCRIPT_FILE%%.*}
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
step_config() {
seq_config() {
## or to use sequencer api with global config file:
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
@@ -25,21 +25,21 @@ step_config() {
CONFIG=1
else
# End if no configuration file exists
[ $DRY -eq 0 ] && return -1
dry || return -1
fi
toolCredentialDir="$MACO_BASE_DIR/.config/matrix-commander"
toolEncStoreDir="$MACO_BASE_DIR/.local/share/matrix-commander"
## Apt cmdline option to suppress user interaction
[ $QUIET -ne 0 ] && APTOPT="-y"
quiet && APTOPT="-y"
## Return of non zero value will abort the sequence
return 0
}
step_1_info() { echo "Run $toolName"; }
step_1_alias() { ALIAS="run"; }
step_1_alias() { echo "run"; }
step_1() {
shift
exe "$MACO_BASE_DIR/bin/python3" "$MACO_DIR/matrix-commander.py" "$@"
@@ -50,14 +50,14 @@ step_3_info() {
echo "Send message"
echoinfo "Each string ([MESSAGE]) is send as separate message"
}
step_3_alias() { ALIAS="message"; }
step_3_alias() { echo "message"; }
step_3() {
shift
step run -m "$@"
}
step_50_info() { echo "Install $toolName dependencies"; }
step_50_alias() { ALIAS="install"; }
step_50_alias() { echo "install"; }
step_50() {
apt install $toolDeps $APTOPT
}
@@ -91,7 +91,7 @@ dbus-python
notify2
NOTES_END
exe read -p "Enter to continue..."
exe "$DEFAULT_EDITOR_SYSTEM" "$MACO_DIR/requirements.txt"
exe editor "$MACO_DIR/requirements.txt"
exe sudo -u $MACO_USER ${MACO_BASE_DIR}/bin/pip install -r ${MACO_DIR}/requirements.txt
}
@@ -99,7 +99,7 @@ step_55_info() {
echo "Create systemd service for $toolName"
echoinfo "(Make sure to modify the service content in the step configuration)"
}
step_55_alias() { ALIAS="service"; }
step_55_alias() { echo "service"; }
step_55() {
local macommanderServiceLoc="/etc/systemd/system/matrix-commander.service"
addConf -s "$MACO_SERVICE" "$macommanderServiceLoc"
@@ -107,19 +107,19 @@ step_55() {
}
step_57_info() { echo "First run to create credential file and encryption store"; }
step_57_alias() { ALIAS="firstrun"; }
step_57_alias() { echo "firstrun"; }
step_57() {
exe sudo -u "$MACO_USER" mkdir -p "$toolCredentialDir" "$toolEncStoreDir"
exe cd "$toolCredentialDir"
step run
[ -e ./store ] && exe mv store "$toolEncStoreDir"
echoseq " [I] use \"$SEQ_NAME run --verify\" to verify against an existing session (like Element)"
info "use \"$SEQ_NAME run --verify\" to verify against an existing session (like Element)"
}
step_60_alias() { ALIAS="notes"; }
step_60_alias() { echo "notes"; }
step_60() {
outColor green
color green
cat <<NOTES_EOF
# Verify matrix-commander "device"
@@ -140,5 +140,5 @@ credentials.json - $MACO_BASE_DIR/.config/matrix-commander/credentials.json
NOTES_EOF
}
VERSION_SEQREV=15
readonly sqr_minVersion=16
. /usr/local/bin/sequencer.sh