envsdotnet-matrix-conf/usr/local/bin/update_matrix-media.sh
2021-08-01 14:34:00 +02:00

18 lines
585 B
Bash
Executable File

#!/usr/bin/env bash
[ "$(id -u)" -ne 0 ] && printf 'Please run as root!\n' && exit 1
ver="$1"
[ -z "$ver" ] && printf 'use: %s <version>\n' "${0##*/}" && exit 1
systemctl stop matrix-media.service
wget -O /opt/matrix-media-repo/media_repo-linux-x64 https://github.com/turt2live/matrix-media-repo/releases/download/v"$ver"/media_repo-linux-x64
chmod +x /opt/matrix-media-repo/media_repo-linux-x64
wget -O /opt/matrix-media-repo/config.sample.yaml https://raw.githubusercontent.com/turt2live/matrix-media-repo/master/config.sample.yaml
systemctl start matrix-media.service
exit 0