1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/jellyfin_ynh.git synced 2024-09-03 19:26:29 +02:00
jellyfin_ynh/scripts/upgrade
2020-07-21 23:37:00 +02:00

77 lines
2.5 KiB
Bash

#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu
# See comments in install script
app=$YNH_APP_INSTANCE_NAME
final_path=/opt/yunohost/$app
# Source YunoHost helpers
source /usr/share/yunohost/helpers
# Stop jellyfin service
systemctl stop jellyfin
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_app_setting_set "$app" final_path "$final_path"
# Download, check integrity, uncompress and patch the source from jellyfin-ffmpeg-[arch].src
case $(uname -m) in
x86_64) ynh_setup_source "$final_path" "jellyfin-ffmpeg-amd64" ;;
aarch64) ynh_setup_source "$final_path" "jellyfin-ffmpeg-arm64" ;;
armv7l) ynh_setup_source "$final_path" "jellyfin-ffmpeg-armhf" ;;
*) ynh_die "Unknown arch" ;;
esac
# Download, check integrity, uncompress and patch the source from jellyfin-server-[arch].src
case $(uname -m) in
x86_64) ynh_setup_source "$final_path" "jellyfin-server-amd64" ;;
aarch64) ynh_setup_source "$final_path" "jellyfin-server-arm64" ;;
armv7l) ynh_setup_source "$final_path" "jellyfin-server-armhf" ;;
*) ynh_die "Unknown arch" ;;
esac
# Download, check integrity, uncompress and patch the source from jellyfin-web.src
case $(uname -m) in
x86_64) ynh_setup_source "$final_path" "jellyfin-web" ;;
aarch64) ynh_setup_source "$final_path" "jellyfin-web" ;;
armv7l) ynh_setup_source "$final_path" "jellyfin-web" ;;
*) ynh_die "Unknown arch" ;;
esac
#==============================================
# INSTALL JELLYFIN
#==============================================
apt-get install -y "$final_path"/jellyfin-ffmpeg.deb
apt-get install -y "$final_path"/jellyfin-server.deb
apt-get install -y "$final_path"/jellyfin-web.deb
rm "$final_path"/*.deb
#=================================================
# NGINX CONFIGURATION
#=================================================
# Create a dedicated nginx config
#ynh_add_nginx_config
#=================================================
# UPGRADE CONFIG
#=================================================
#cp -a ../conf/loolwsd.xml /etc/loolwsd
#ynh_replace_string "__NEXTCLOUDDOMAIN__" "$nextcloud_domain" "/etc/loolwsd/loolwsd.xml"
#ynh_replace_string "__PASSWORD__" "$password" "/etc/loolwsd/loolwsd.xml"
#systemctl restart loolwsd
# If app is public, add url to SSOWat conf as skipped_uris
#if [[ $is_public -eq 1 ]]; then
# See install script
# ynh_app_setting_set "$app" unprotected_uris "/"
#fi
# Start jellyfin service
systemctl start jellyfin