|
|
|
@@ -21,8 +21,8 @@
|
|
|
|
# shellcheck disable=SC2329
|
|
|
|
# shellcheck disable=SC2329
|
|
|
|
shopt -s extglob
|
|
|
|
shopt -s extglob
|
|
|
|
|
|
|
|
|
|
|
|
declare -g SCRIPT_VERSION="1.35.7"
|
|
|
|
declare -g SCRIPT_VERSION="1.35.13-dev"
|
|
|
|
declare -g MC_VERSION_HARDCODE="35.0.37" # do find all replace
|
|
|
|
declare -g MC_VERSION_HARDCODE="35.0.43" # do find all replace
|
|
|
|
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
|
|
|
|
declare -g MC_REPO_HARDCODE="bookworm" # should match the MC_VERSION_HARDCODE
|
|
|
|
declare -g BOARD_ID="92.0" # MC35 board ID for fallback latest version detection
|
|
|
|
declare -g BOARD_ID="92.0" # MC35 board ID for fallback latest version detection
|
|
|
|
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
|
|
|
declare -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
|
|
|
@@ -236,18 +236,15 @@ init() {
|
|
|
|
declare -g USER
|
|
|
|
declare -g USER
|
|
|
|
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
|
|
|
|
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
|
|
|
|
declare -g SCRIPT_DIR; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
|
|
|
|
declare -g SCRIPT_DIR; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
|
|
|
|
|
|
|
|
declare -gi SCRIPT_IS_PIPED=0
|
|
|
|
|
|
|
|
|
|
|
|
# Detect if script is being piped (SCRIPT_PATH won't be a regular file)
|
|
|
|
# Detect if script is being piped (SCRIPT_PATH won't be a regular file)
|
|
|
|
if [[ ! -f $SCRIPT_PATH ]]; then
|
|
|
|
[[ ! -f $SCRIPT_PATH ]] && SCRIPT_IS_PIPED=1
|
|
|
|
declare -g SCRIPT_IS_PIPED=1
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
declare -g SCRIPT_IS_PIPED=0
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
|
|
|
|
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
|
|
|
|
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
|
|
|
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
|
|
|
declare -g CREATEREPO_USER="$USER" # can be root
|
|
|
|
declare -g CREATEREPO_USER="$USER" # can be root
|
|
|
|
declare -g ID VERSION_ID ARCH MC_ARCH NAME
|
|
|
|
declare -g ID VERSION_ID UBUNTU_CODENAME VERSION_CODENAME ARCH MC_ARCH NAME
|
|
|
|
declare -g MC_MVERSION MC_RELEASE MC_PKG MC_RPM MC_ROOT
|
|
|
|
declare -g MC_MVERSION MC_RELEASE MC_PKG MC_RPM MC_ROOT
|
|
|
|
declare -ga PKG_INSTALL PKG_REMOVE PKG_UPDATE PKG_QUERY
|
|
|
|
declare -ga PKG_INSTALL PKG_REMOVE PKG_UPDATE PKG_QUERY
|
|
|
|
declare -ga SERVICES CONTAINERS
|
|
|
|
declare -ga SERVICES CONTAINERS
|
|
|
|
@@ -265,7 +262,7 @@ init() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Run the self-updater if enabled
|
|
|
|
# Run the self-updater if enabled
|
|
|
|
((SELF_UPDATE_SWITCH)) && update "$@"
|
|
|
|
((SELF_UPDATE_SWITCH)) && ((! SCRIPT_IS_PIPED)) && update "$@"
|
|
|
|
|
|
|
|
|
|
|
|
# Check that the .jriver directory is owned by the user
|
|
|
|
# Check that the .jriver directory is owned by the user
|
|
|
|
((YES_SWITCH)) || fix_permissions "$HOME/.jriver" "$USER"
|
|
|
|
((YES_SWITCH)) || fix_permissions "$HOME/.jriver" "$USER"
|
|
|
|
@@ -390,20 +387,10 @@ init() {
|
|
|
|
# Set default targets
|
|
|
|
# Set default targets
|
|
|
|
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
|
|
|
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
|
|
|
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
|
|
|
|
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
|
|
|
|
|
|
|
|
MC_REPO="${MC_REPO_USER:-${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}}" # user>host>hardcoded
|
|
|
|
# Repo selection (precedence: user > host (MC31+ debian/ubuntu) > hardcoded)
|
|
|
|
|
|
|
|
if [[ -n $MC_REPO_USER ]]; then
|
|
|
|
|
|
|
|
MC_REPO="$MC_REPO_USER"
|
|
|
|
|
|
|
|
elif [[ $ID =~ debian|ubuntu && "${MC_MVERSION_USER:-${MC_VERSION_HARDCODE%%.*}}" -ge 31 ]]; then
|
|
|
|
|
|
|
|
MC_REPO=${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
MC_REPO="$MC_REPO_HARDCODE"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
|
|
|
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
|
|
|
|
|
|
|
|
|
|
|
set_mc_version
|
|
|
|
set_mc_version
|
|
|
|
|
|
|
|
|
|
|
|
echo "Selected MC version $MC_VERSION from the $MC_REPO repo (via $MC_VERSION_SOURCE)"
|
|
|
|
echo "Selected MC version $MC_VERSION from the $MC_REPO repo (via $MC_VERSION_SOURCE)"
|
|
|
|
|
|
|
|
|
|
|
|
# Set additional MC version variables
|
|
|
|
# Set additional MC version variables
|
|
|
|
@@ -614,15 +601,13 @@ install_external_repos() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# @description Installs host-specific temporary legacy repo for missing dependencies
|
|
|
|
# @description Installs host-specific temporary legacy repo for missing dependencies
|
|
|
|
install_legacy_repo() {
|
|
|
|
add_legacy_repo() {
|
|
|
|
debug "${FUNCNAME[0]}()"
|
|
|
|
debug "${FUNCNAME[0]}()"
|
|
|
|
local major_version="${VERSION_ID%%.*}"
|
|
|
|
|
|
|
|
local minor_version="${VERSION_ID##*.}"; minor_version="${minor_version#0}" # strip leading zero
|
|
|
|
|
|
|
|
local repo_name repo_uri repo_suite repo_key temp_repo_file
|
|
|
|
local repo_name repo_uri repo_suite repo_key temp_repo_file
|
|
|
|
|
|
|
|
|
|
|
|
case $ID in
|
|
|
|
case $ID in
|
|
|
|
ubuntu)
|
|
|
|
ubuntu)
|
|
|
|
if [[ $major_version -gt 24 || ( $major_version -eq 24 && minor_version -ge 4 ) ]]; then
|
|
|
|
if [[ $UBUNTU_CODENAME =~ ^[n-z] ]]; then # noble and later
|
|
|
|
echo "Temporarily adding jammy repository for libwebkit2gtk-4.0-37, etc."
|
|
|
|
echo "Temporarily adding jammy repository for libwebkit2gtk-4.0-37, etc."
|
|
|
|
repo_name="ubuntu-jammy-temp"
|
|
|
|
repo_name="ubuntu-jammy-temp"
|
|
|
|
repo_uri="https://archive.ubuntu.com/ubuntu"
|
|
|
|
repo_uri="https://archive.ubuntu.com/ubuntu"
|
|
|
|
@@ -631,7 +616,7 @@ install_legacy_repo() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
debian)
|
|
|
|
debian)
|
|
|
|
if [[ $major_version -ge 13 ]]; then
|
|
|
|
if [[ ${VERSION_ID%%.*} -ge 13 ]]; then
|
|
|
|
echo "Temporarily adding bookworm repository for libwebkit2gtk-4.0-37, etc."
|
|
|
|
echo "Temporarily adding bookworm repository for libwebkit2gtk-4.0-37, etc."
|
|
|
|
repo_name="debian-bookworm-temp"
|
|
|
|
repo_name="debian-bookworm-temp"
|
|
|
|
repo_uri="https://deb.debian.org/debian"
|
|
|
|
repo_uri="https://deb.debian.org/debian"
|
|
|
|
@@ -656,6 +641,12 @@ install_legacy_repo() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @description Removes temporary legacy repository if present
|
|
|
|
|
|
|
|
remove_legacy_repo() {
|
|
|
|
|
|
|
|
debug "${FUNCNAME[0]}()"
|
|
|
|
|
|
|
|
[[ -n $LEGACY_REPO_FILE ]] && execute sudo rm -f "$LEGACY_REPO_FILE"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# @description Acquires the source DEB package from JRiver
|
|
|
|
# @description Acquires the source DEB package from JRiver
|
|
|
|
acquire_deb() {
|
|
|
|
acquire_deb() {
|
|
|
|
debug "${FUNCNAME[0]}()"
|
|
|
|
debug "${FUNCNAME[0]}()"
|
|
|
|
@@ -788,6 +779,8 @@ translate_packages() {
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/webkit2gtk4.0}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/webkit2gtk4.0}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/webkit2gtk4.1}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/webkit2gtk4.1}")
|
|
|
|
requires_arr=("${requires_arr[@]/libsdbus-c++1/sdbus-cpp}")
|
|
|
|
requires_arr=("${requires_arr[@]/libsdbus-c++1/sdbus-cpp}")
|
|
|
|
|
|
|
|
requires_arr=("${requires_arr[@]/libdbus-1-3/dbus-libs}")
|
|
|
|
|
|
|
|
requires_arr=("${requires_arr[@]/libxss1/libXScrnSaver}")
|
|
|
|
recommends_arr=("${recommends_arr[@]/fdkaac/fdk-aac-free}")
|
|
|
|
recommends_arr=("${recommends_arr[@]/fdkaac/fdk-aac-free}")
|
|
|
|
recommends_arr+=("mesa-va-drivers-freeworld|mesa-va-drivers")
|
|
|
|
recommends_arr+=("mesa-va-drivers-freeworld|mesa-va-drivers")
|
|
|
|
recommends_arr+=("mesa-vulkan-drivers-freeworld|mesa-vulkan-drivers")
|
|
|
|
recommends_arr+=("mesa-vulkan-drivers-freeworld|mesa-vulkan-drivers")
|
|
|
|
@@ -813,6 +806,7 @@ translate_packages() {
|
|
|
|
requires_arr=("${requires_arr[@]/libharfbuzz0b/libharfbuzz0}")
|
|
|
|
requires_arr=("${requires_arr[@]/libharfbuzz0b/libharfbuzz0}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/libwebkit2gtk-4_0-37}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.0*/libwebkit2gtk-4_0-37}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/libwebkit2gtk-4_1-0}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1*/libwebkit2gtk-4_1-0}")
|
|
|
|
|
|
|
|
requires_arr=("${requires_arr[@]/libxss1/libXss1}")
|
|
|
|
for i in "${!requires_arr[@]}"; do
|
|
|
|
for i in "${!requires_arr[@]}"; do
|
|
|
|
[[ ${requires_arr[$i]} == "mesa-vulkan-drivers" ]] && unset -v 'requires_arr[i]'
|
|
|
|
[[ ${requires_arr[$i]} == "mesa-vulkan-drivers" ]] && unset -v 'requires_arr[i]'
|
|
|
|
[[ ${requires_arr[$i]} == "libsdbus-c++1" ]] && unset -v 'requires_arr[i]'
|
|
|
|
[[ ${requires_arr[$i]} == "libsdbus-c++1" ]] && unset -v 'requires_arr[i]'
|
|
|
|
@@ -854,6 +848,8 @@ translate_packages() {
|
|
|
|
requires_arr=("${requires_arr[@]/mesa-vulkan-drivers/lib64dri-drivers}")
|
|
|
|
requires_arr=("${requires_arr[@]/mesa-vulkan-drivers/lib64dri-drivers}")
|
|
|
|
requires_arr=("${requires_arr[@]/vulkan-icd/vulkan-loader}")
|
|
|
|
requires_arr=("${requires_arr[@]/vulkan-icd/vulkan-loader}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1-0/lib64webkit2gtk4.1}")
|
|
|
|
requires_arr=("${requires_arr[@]/libwebkit2gtk-4.1-0/lib64webkit2gtk4.1}")
|
|
|
|
|
|
|
|
requires_arr=("${requires_arr[@]/libdbus-1-3/libdbus-1_3}")
|
|
|
|
|
|
|
|
requires_arr=("${requires_arr[@]/libxss1/libxscrnsaver1}")
|
|
|
|
recommends_arr=("${recommends_arr[@]/musepack-tools/mppenc}")
|
|
|
|
recommends_arr=("${recommends_arr[@]/musepack-tools/mppenc}")
|
|
|
|
for i in "${!recommends_arr[@]}"; do
|
|
|
|
for i in "${!recommends_arr[@]}"; do
|
|
|
|
[[ ${recommends_arr[$i]} == "fdkaac" ]] && unset -v 'recommends_arr[i]'
|
|
|
|
[[ ${recommends_arr[$i]} == "fdkaac" ]] && unset -v 'recommends_arr[i]'
|
|
|
|
@@ -861,8 +857,8 @@ translate_packages() {
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
arch)
|
|
|
|
arch)
|
|
|
|
# Set these manually for Arch since they are quite different
|
|
|
|
# Set these manually for Arch since they are quite different
|
|
|
|
requires_arr=('alsa-lib' 'ca-certificates' 'gtk3' 'gcc-libs' 'libx11' 'libxext'
|
|
|
|
requires_arr=('alsa-lib' 'ca-certificates' 'dbus' 'gtk3' 'gcc-libs' 'libx11' 'libxext'
|
|
|
|
'libxcb' 'libxau' 'libxdmcp' 'util-linux' 'mesa-libgl' 'webkit2gtk')
|
|
|
|
'libxcb' 'libxau' 'libxdmcp' 'libxss' 'util-linux' 'mesa-libgl' 'webkit2gtk')
|
|
|
|
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
|
|
|
recommends_arr=('mesa-libgl' 'nvidia-libgl' 'nvidia-utils' 'vulkan-intel'
|
|
|
|
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
|
|
|
'vulkan-radeon' 'vorbis-tools' 'musepack-tools')
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
@@ -1020,7 +1016,7 @@ install_mc_deb() {
|
|
|
|
execute sed -E -i 's/,[[:space:]]*libwebkit2gtk[^,]*(,|\?)?//g' control
|
|
|
|
execute sed -E -i 's/,[[:space:]]*libwebkit2gtk[^,]*(,|\?)?//g' control
|
|
|
|
|
|
|
|
|
|
|
|
# TODO workaround for legacy ZorinOS
|
|
|
|
# TODO workaround for legacy ZorinOS
|
|
|
|
if [[ $ID == "ubuntu" && ${VERSION_ID%.*} -le 16 ]] &&
|
|
|
|
if [[ $ID == "ubuntu" && ${VERSION_ID%%.*} -le 16 ]] &&
|
|
|
|
grep -q zorin /etc/os-release; then
|
|
|
|
grep -q zorin /etc/os-release; then
|
|
|
|
execute sed -i 's/libva2/libva1/g' control
|
|
|
|
execute sed -i 's/libva2/libva1/g' control
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
@@ -1033,8 +1029,8 @@ install_mc_deb() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Add older repository for libwebkit2gtk-4.0-37, etc, on newer Debian/Ubuntu
|
|
|
|
# Add older repository for libwebkit2gtk-4.0-37, etc, on newer Debian/Ubuntu
|
|
|
|
install_legacy_repo
|
|
|
|
add_legacy_repo
|
|
|
|
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
|
|
|
|
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; remove_legacy_repo; return 1; }
|
|
|
|
|
|
|
|
|
|
|
|
# Copy the DEB to a temporary file so _apt can read it
|
|
|
|
# Copy the DEB to a temporary file so _apt can read it
|
|
|
|
debug "Creating temporary deb file owned by _apt"
|
|
|
|
debug "Creating temporary deb file owned by _apt"
|
|
|
|
@@ -1051,13 +1047,15 @@ install_mc_deb() {
|
|
|
|
--reinstall \
|
|
|
|
--reinstall \
|
|
|
|
"$temp_deb"; then
|
|
|
|
"$temp_deb"; then
|
|
|
|
err "Local MC DEB installation failed"
|
|
|
|
err "Local MC DEB installation failed"
|
|
|
|
|
|
|
|
remove_legacy_repo
|
|
|
|
execute sudo rm -f "$temp_deb"
|
|
|
|
execute sudo rm -f "$temp_deb"
|
|
|
|
if ask_ok "Remove source DEB and retry?"; then
|
|
|
|
if ask_ok "Remove source DEB and retry?"; then
|
|
|
|
execute sudo rm -f "$MC_DEB"
|
|
|
|
execute sudo rm -f "$MC_DEB"
|
|
|
|
exec bash "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
|
rerun "$@"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
remove_legacy_repo
|
|
|
|
execute sudo rm -f "$temp_deb"
|
|
|
|
execute sudo rm -f "$temp_deb"
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -1166,7 +1164,7 @@ link_ssl_certs() {
|
|
|
|
for f in "${source_certs[@]}"; do
|
|
|
|
for f in "${source_certs[@]}"; do
|
|
|
|
if [[ -f $f ]]; then
|
|
|
|
if [[ -f $f ]]; then
|
|
|
|
if execute sudo ln -fs "$f" "$mc_cert_link"; then
|
|
|
|
if execute sudo ln -fs "$f" "$mc_cert_link"; then
|
|
|
|
debug "Symlinked $mc_cert_link to $f"
|
|
|
|
echo "Symlinked $mc_cert_link to $f"
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
@@ -1214,6 +1212,7 @@ restore_license() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1602,16 +1601,6 @@ uninstall() {
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Remove the repository files
|
|
|
|
|
|
|
|
for file in "/etc/yum.repos.d/jriver.repo" /etc/apt/sources.list.d/{jriver,mediacenter}*.{list,sources}; do
|
|
|
|
|
|
|
|
if [[ -e $file ]]; then
|
|
|
|
|
|
|
|
echo "Removing repository file: $file"
|
|
|
|
|
|
|
|
execute sudo rm -f "$file"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[ $ID == "suse" ]] && execute sudo zypper --non-interactive removerepo jriver
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Removing firewall rules"
|
|
|
|
echo "Removing firewall rules"
|
|
|
|
for service in jriver-mediacenter jriver-xvnc jriver-x11vnc; do
|
|
|
|
for service in jriver-mediacenter jriver-xvnc jriver-x11vnc; do
|
|
|
|
if command -v firewall-cmd &>/dev/null; then
|
|
|
|
if command -v firewall-cmd &>/dev/null; then
|
|
|
|
@@ -1634,6 +1623,16 @@ uninstall() {
|
|
|
|
err "Could not remove Media Center package"
|
|
|
|
err "Could not remove Media Center package"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Remove the repository files
|
|
|
|
|
|
|
|
for file in "/etc/yum.repos.d/jriver.repo" /etc/apt/sources.list.d/{jriver,mediacenter}*.{list,sources}; do
|
|
|
|
|
|
|
|
if [[ -e $file ]]; then
|
|
|
|
|
|
|
|
echo "Removing repository file: $file"
|
|
|
|
|
|
|
|
execute sudo rm -f "$file"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[ $ID == "suse" ]] && execute sudo zypper --non-interactive removerepo jriver
|
|
|
|
|
|
|
|
|
|
|
|
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
|
|
|
|
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
|
|
|
|
if [[ -f $keyfile ]]; then
|
|
|
|
if [[ -f $keyfile ]]; then
|
|
|
|
echo "Removing the JRiver Media Center GPG key"
|
|
|
|
echo "Removing the JRiver Media Center GPG key"
|
|
|
|
@@ -1716,7 +1715,7 @@ update() {
|
|
|
|
# If the commit hash has changed, an update occurred
|
|
|
|
# If the commit hash has changed, an update occurred
|
|
|
|
if [[ "$before_pull_hash" != $(git -C "$SCRIPT_DIR" rev-parse HEAD) ]]; then
|
|
|
|
if [[ "$before_pull_hash" != $(git -C "$SCRIPT_DIR" rev-parse HEAD) ]]; then
|
|
|
|
echo "Detected installJRMC update, restarting"
|
|
|
|
echo "Detected installJRMC update, restarting"
|
|
|
|
exec bash "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
|
rerun "$@"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
else
|
|
|
|
debug "Not in the installJRMC repository, checking for installJRMC update via webscrape."
|
|
|
|
debug "Not in the installJRMC repository, checking for installJRMC update via webscrape."
|
|
|
|
@@ -1747,7 +1746,7 @@ update() {
|
|
|
|
execute rm -f "$tmp"
|
|
|
|
execute rm -f "$tmp"
|
|
|
|
|
|
|
|
|
|
|
|
echo "Detected installJRMC update, restarting"
|
|
|
|
echo "Detected installJRMC update, restarting"
|
|
|
|
exec bash "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
|
rerun "$@"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
debug "Current installJRMC $SCRIPT_VERSION is the latest version"
|
|
|
|
debug "Current installJRMC $SCRIPT_VERSION is the latest version"
|
|
|
|
execute rm -f "$tmp"
|
|
|
|
execute rm -f "$tmp"
|
|
|
|
@@ -1799,9 +1798,8 @@ main() {
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
debian|ubuntu)
|
|
|
|
debian|ubuntu)
|
|
|
|
local major_version="${VERSION_ID%%.*}"
|
|
|
|
local keyurl="https://dist.jriver.com/mediacenter@jriver.com.gpg.complete"
|
|
|
|
local minor_version="${VERSION_ID##*.}"; minor_version="${minor_version#0}" # strip leading zero
|
|
|
|
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring-complete.gpg"
|
|
|
|
local keyfile="/usr/share/keyrings/jriver-com-archive-keyring.gpg"
|
|
|
|
|
|
|
|
local channel="latest"
|
|
|
|
local channel="latest"
|
|
|
|
[[ -n $BETAPASS ]] && channel="beta"
|
|
|
|
[[ -n $BETAPASS ]] && channel="beta"
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1811,27 +1809,21 @@ main() {
|
|
|
|
repo_file="/etc/apt/sources.list.d/jriver.sources"
|
|
|
|
repo_file="/etc/apt/sources.list.d/jriver.sources"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installing repository file: $repo_file"
|
|
|
|
|
|
|
|
if [[ ($ID == "ubuntu" && $major_version -ge 24) ||
|
|
|
|
|
|
|
|
($ID == "debian" && (-z $major_version || $major_version -ge 12)) ]]; then
|
|
|
|
|
|
|
|
sudo tee "$repo_file" &>/dev/null <<-EOF
|
|
|
|
|
|
|
|
Types: deb
|
|
|
|
|
|
|
|
URIs: https://dist.jriver.com/$channel/mediacenter/
|
|
|
|
|
|
|
|
Signed-By: $keyfile
|
|
|
|
|
|
|
|
Suites: $MC_REPO
|
|
|
|
|
|
|
|
Components: main
|
|
|
|
|
|
|
|
Architectures: amd64 armhf arm64
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
sudo tee "$repo_file" &>/dev/null <<-EOF
|
|
|
|
|
|
|
|
deb [signed-by=$keyfile arch=amd64,armhf,arm64] https://dist.jriver.com/$channel/mediacenter/ $MC_REPO main
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installing JRiver Media Center GPG key"
|
|
|
|
echo "Installing JRiver Media Center GPG key"
|
|
|
|
download "https://dist.jriver.com/mediacenter@jriver.com.gpg.key" "-" |
|
|
|
|
download "$keyurl" "-" |
|
|
|
|
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
|
|
|
|
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
|
|
|
|
install_legacy_repo
|
|
|
|
|
|
|
|
|
|
|
|
echo "Installing repository file: $repo_file"
|
|
|
|
|
|
|
|
sudo tee "$repo_file" &>/dev/null <<-EOF
|
|
|
|
|
|
|
|
Types: deb
|
|
|
|
|
|
|
|
URIs: https://dist.jriver.com/$channel/mediacenter/
|
|
|
|
|
|
|
|
Signed-By: $keyfile
|
|
|
|
|
|
|
|
Suites: $MC_REPO
|
|
|
|
|
|
|
|
Components: main
|
|
|
|
|
|
|
|
Architectures: amd64 armhf arm64
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_legacy_repo
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
*)
|
|
|
|
err "An MC repository for $ID is not yet available"
|
|
|
|
err "An MC repository for $ID is not yet available"
|
|
|
|
@@ -1843,16 +1835,10 @@ main() {
|
|
|
|
echo "Updating package lists"
|
|
|
|
echo "Updating package lists"
|
|
|
|
if ! execute "${PKG_UPDATE[@]}"; then
|
|
|
|
if ! execute "${PKG_UPDATE[@]}"; then
|
|
|
|
err "Package update failed!"
|
|
|
|
err "Package update failed!"
|
|
|
|
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
|
|
|
remove_legacy_repo
|
|
|
|
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]]; then
|
|
|
|
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]]; then
|
|
|
|
echo "Rerunning installJRMC with --mcrepo=$MC_REPO_HARDCODE"
|
|
|
|
echo "Rerunning installJRMC with --mcrepo=$MC_REPO_HARDCODE"
|
|
|
|
if ((SCRIPT_IS_PIPED)); then
|
|
|
|
rerun "$@" "--mcrepo=$MC_REPO_HARDCODE"
|
|
|
|
# Re-download and execute if script was piped
|
|
|
|
|
|
|
|
curl -fsSL "$SCRIPT_URL" | bash -s -- "$@" "--no-update" "--mcrepo=$MC_REPO_HARDCODE"
|
|
|
|
|
|
|
|
exit $?
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
exec bash "$SCRIPT_PATH" "$@" "--no-update" "--mcrepo=$MC_REPO_HARDCODE"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
@@ -1860,12 +1846,12 @@ main() {
|
|
|
|
echo "Installing $MC_PKG package"
|
|
|
|
echo "Installing $MC_PKG package"
|
|
|
|
if ! install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_PKG"; then
|
|
|
|
if ! install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_PKG"; then
|
|
|
|
err "MC package install failed!"
|
|
|
|
err "MC package install failed!"
|
|
|
|
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
|
|
|
remove_legacy_repo
|
|
|
|
return 1
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Clean up legacy repo after successful install
|
|
|
|
# Clean up legacy repo after successful install
|
|
|
|
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
|
|
|
remove_legacy_repo
|
|
|
|
|
|
|
|
|
|
|
|
link_ssl_certs
|
|
|
|
link_ssl_certs
|
|
|
|
restore_license
|
|
|
|
restore_license
|
|
|
|
@@ -1912,6 +1898,13 @@ main() {
|
|
|
|
arch) install_mc_arch ;;
|
|
|
|
arch) install_mc_arch ;;
|
|
|
|
unknown) install_mc_generic ;;
|
|
|
|
unknown) install_mc_generic ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2181
|
|
|
|
|
|
|
|
if [[ $? -eq 0 ]]; then
|
|
|
|
|
|
|
|
echo "Successfully installed JRiver Media Center"
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
err "MC package install failed!"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
link_ssl_certs
|
|
|
|
link_ssl_certs
|
|
|
|
restore_license
|
|
|
|
restore_license
|
|
|
|
@@ -2015,7 +2008,7 @@ create_mc_apt_container() {
|
|
|
|
CNT=$(buildah from --quiet alpine:edge) &&
|
|
|
|
CNT=$(buildah from --quiet alpine:edge) &&
|
|
|
|
buildah run --env MC_REPO="$repo" --env MC_ARCH="$MC_ARCH" --env CHANNEL="$channel" "$CNT" -- sh -c '
|
|
|
|
buildah run --env MC_REPO="$repo" --env MC_ARCH="$MC_ARCH" --env CHANNEL="$channel" "$CNT" -- sh -c '
|
|
|
|
apk add --quiet --no-progress --no-cache apt curl gnupg
|
|
|
|
apk add --quiet --no-progress --no-cache apt curl gnupg
|
|
|
|
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.key | gpg --quiet --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
|
|
|
curl -fsSL https://dist.jriver.com/mediacenter@jriver.com.gpg.complete | gpg --quiet --dearmor -o /usr/share/keyrings/jriver-com-archive-keyring.gpg
|
|
|
|
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
|
|
|
cat <<-EOF > /etc/apt/sources.list.d/jriver.sources
|
|
|
|
Types: deb
|
|
|
|
Types: deb
|
|
|
|
URIs: https://dist.jriver.com/$CHANNEL/mediacenter/
|
|
|
|
URIs: https://dist.jriver.com/$CHANNEL/mediacenter/
|
|
|
|
@@ -2030,6 +2023,16 @@ create_mc_apt_container() {
|
|
|
|
buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
|
|
|
buildah run "$CNT" -- sh -c "$cmd" || { err "$cmd failed"; return 1; }
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rerun() {
|
|
|
|
|
|
|
|
debug "${FUNCNAME[0]}()" "$@"
|
|
|
|
|
|
|
|
if ((SCRIPT_IS_PIPED)); then
|
|
|
|
|
|
|
|
# Re-download and execute if script was piped
|
|
|
|
|
|
|
|
curl -fsSL "$SCRIPT_URL" | bash -s -- "$@" "--no-update"
|
|
|
|
|
|
|
|
exit $?
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
exec bash "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Roughly turn debugging on for pre-init
|
|
|
|
# Roughly turn debugging on for pre-init
|
|
|
|
# Reset and reparse in parse_input() with getopt
|
|
|
|
# Reset and reparse in parse_input() with getopt
|
|
|
|
|