#!/bin/bash version=$1 if [ ! -n "$version" ];then read -p "Enter or press the Enter key to use the latest version: " version fi if [ ! -n "$version" ];then version=`wget -q -O- https://api.github.com/repos/jellyfin/jellyfin-ffmpeg/releases/latest | grep tag_name | awk -F '"' '{print $4}'` fi nversion=`echo $version|sed 's/v//'` cd /tmp wget -c "https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/${version}/jellyfin-ffmpeg_${nversion}_portable_linux64-gpl.tar.xz" if [ $? -ne 0 ]; then echo "download failed" exit 1 fi tar axvf jellyfin-ffmpeg_${nversion}_portable_linux64-gpl.tar.xz if [ $? -ne 0 ]; then echo "extract failed" exit 1 fi rm -rf /usr/bin/ffmpeg rm -rf /usr/bin/ffprobe mv ffmpeg ffprobe /usr/bin/ chown +x /usr/bin/ffmpeg chown +x /usr/bin/ffprobe /usr/bin/ffmpeg -version