#!/usr/bin/env bash set -euo pipefail LOGFILE="$HOME/.local/logs/update_roms.log" log() { echo "[$(date --iso-8601=seconds)] $*" | tee -a "$LOGFILE"; } ROM_MANAGER_BIN="$(command -v srm || true)" if [ -z "$ROM_MANAGER_BIN" ]; then log "ERROR: srm (Steam ROM Manager) not found in PATH" exit 127 fi log "Updating Steam ROM Manager" $ROM_MANAGER_BIN add >> "$LOGFILE" 2>&1 || { log "ERROR: Steam ROM Manager update failed" exit 1 } log "Steam ROM Manager update completed successfully, restarting Steam service if running" if systemctl --user is-active --quiet steam.scope; then log "Restarting Steam service to apply changes" systemctl --user restart steam.scope log "Steam service restarted" else log "Steam service is not running, no need to restart" fi