#!/bin/bash MINISERVER="$HOME/.local/share/MiniServer" run_update() { local status=0 gateway=0 bash "$MINISERVER/sandbox/setup.sh" || status=1 # Hermes update asks a running gateway to finish its work and restart, but # that signal (SIGUSR1) reaches srt, not the gateway inside its sandbox, so # the update would wait half an hour. Stop the gateway for the update instead; # starting it afterwards also loads new sandbox rules and dependencies. if systemctl --user is-active --quiet hermes-gateway.service; then gateway=1 systemctl --user stop hermes-gateway.service || status=1 fi # The real command, not the sandboxed one in sandbox/bin: updating Hermes # writes outside what its sandbox allows. python-olm, for Matrix, bundles a # CMake file too old for CMake 4 unless told which policies to use. if [ -x "$HOME/.local/bin/hermes" ]; then echo "Updating Hermes Agent..." CMAKE_POLICY_VERSION_MINIMUM=3.5 "$HOME/.local/bin/hermes" update < /dev/null || status=1 fi if [ "$gateway" = 1 ]; then echo "Starting Hermes' gateway..." systemctl --user start hermes-gateway.service || status=1 fi return $status }