|
@@ -3,7 +3,7 @@
|
|
|
# @file installJRMC
|
|
|
# @brief Install JRiver Media Center and associated services
|
|
|
# @description See installJRMC --help or print_help() below for usage
|
|
|
-# Copyright (c) 2021-2024 Bryan C. Roessler
|
|
|
+# Copyright (c) 2021-2025 Bryan C. Roessler
|
|
|
# This software is released under the Apache License.
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
#
|
|
@@ -18,12 +18,13 @@
|
|
|
# * Be careful with tabs in heredocs
|
|
|
shopt -s extglob
|
|
|
|
|
|
-declare -g SCRIPT_VERSION="1.4.6"
|
|
|
+declare -g SCRIPT_VERSION="1.4.7"
|
|
|
declare -g MC_REPO="bullseye" # should match the MC_VERSION
|
|
|
-declare -g MC_VERSION="33.0.49" # Do find all replace
|
|
|
+declare -g MC_VERSION="33.0.61" # Do find all replace
|
|
|
declare -g BOARD_URL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
|
|
|
declare -gi UPDATE_SWITCH=1 # set to 0 to disable automatic self-update
|
|
|
declare -g SCRIPT_URL="https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC"
|
|
|
+# declare -g SCRIPT_URL="https://raw.githubusercontent.com/cryobry/installJRMC/refs/heads/master/installJRMC"
|
|
|
declare -gi DEBUG=${DEBUG:-0} # det default debug and allow DEBUG env override (default: disabled)
|
|
|
|
|
|
# @description Print help text
|
|
@@ -239,15 +240,14 @@ init() {
|
|
|
USER="${SUDO_USER:-$USER}"
|
|
|
fi
|
|
|
|
|
|
- # Set default command arguments and/or parse user input
|
|
|
+ # Parse input commands with getopt
|
|
|
if [[ $# -eq 0 || ! "$*" =~ (--install|--service|--container|--createrepo) ]]; then
|
|
|
debug "Automatically using --install=repo"
|
|
|
- REPO_INSTALL_SWITCH=1
|
|
|
+ declare -gi REPO_INSTALL_SWITCH=1
|
|
|
+ else
|
|
|
+ parse_input "$@"
|
|
|
fi
|
|
|
-
|
|
|
- # Parse input commands with getopt
|
|
|
- [[ $# -gt 0 ]] && parse_input "$@"
|
|
|
-
|
|
|
+
|
|
|
# Run the self-updater if enabled
|
|
|
((UPDATE_SWITCH)) && update "$@"
|
|
|
|
|
@@ -339,30 +339,30 @@ init() {
|
|
|
fedora|centos)
|
|
|
local rpm_mgr
|
|
|
rpm_mgr=$(command -v dnf &>/dev/null && echo "dnf" || echo "yum")
|
|
|
- PKG_INSTALL=(execute sudo "$rpm_mgr" install -y)
|
|
|
- PKG_REMOVE=(execute sudo "$rpm_mgr" remove -y)
|
|
|
- PKG_UPDATE=(execute sudo "$rpm_mgr" makecache)
|
|
|
+ PKG_INSTALL=(sudo "$rpm_mgr" install -y)
|
|
|
+ PKG_REMOVE=(sudo "$rpm_mgr" remove -y)
|
|
|
+ PKG_UPDATE=(sudo "$rpm_mgr" makecache)
|
|
|
PKG_QUERY=(rpm -q)
|
|
|
PKG_INSTALL_LOCAL() { install_mc_rhel; }
|
|
|
;;
|
|
|
debian|ubuntu)
|
|
|
- PKG_INSTALL=(execute sudo apt-get -f install -y -q0)
|
|
|
- PKG_REMOVE=(execute sudo apt-get remove --auto-remove -y -q0)
|
|
|
- PKG_UPDATE=(execute sudo apt-get update -y -q0)
|
|
|
+ PKG_INSTALL=(sudo apt-get -f install -y -q0)
|
|
|
+ PKG_REMOVE=(sudo apt-get remove --auto-remove -y -q0)
|
|
|
+ PKG_UPDATE=(sudo apt-get update -y -q0)
|
|
|
PKG_QUERY=(dpkg -s)
|
|
|
PKG_INSTALL_LOCAL() { install_mc_deb "$@"; }
|
|
|
;;
|
|
|
suse)
|
|
|
- PKG_INSTALL=(execute sudo zypper --gpg-auto-import-keys --non-interactive --quiet install --force --no-confirm)
|
|
|
- PKG_REMOVE=(execute sudo zypper --non-interactive --quiet remove --clean-deps)
|
|
|
- PKG_UPDATE=(execute sudo zypper --non-interactive --quiet refresh jriver)
|
|
|
+ PKG_INSTALL=(sudo zypper --gpg-auto-import-keys --non-interactive --quiet install --force --no-confirm)
|
|
|
+ PKG_REMOVE=(sudo zypper --non-interactive --quiet remove --clean-deps)
|
|
|
+ PKG_UPDATE=(sudo zypper --non-interactive --quiet refresh jriver)
|
|
|
PKG_QUERY=(rpm -q)
|
|
|
PKG_INSTALL_LOCAL() { install_mc_suse; }
|
|
|
;;
|
|
|
arch)
|
|
|
- PKG_INSTALL=(execute sudo pacman -Sy --noconfirm)
|
|
|
- PKG_REMOVE=(execute sudo pacman -Rs --noconfirm)
|
|
|
- PKG_UPDATE=(execute sudo pacman -Syy)
|
|
|
+ PKG_INSTALL=(sudo pacman -Sy --noconfirm)
|
|
|
+ PKG_REMOVE=(sudo pacman -Rs --noconfirm)
|
|
|
+ PKG_UPDATE=(sudo pacman -Syy)
|
|
|
PKG_QUERY=(sudo pacman -Qs)
|
|
|
PKG_INSTALL_LOCAL() { install_mc_arch; }
|
|
|
;;
|
|
@@ -945,8 +945,6 @@ install_mc_deb() {
|
|
|
# @description Installs Media Center RPM package on RHEL distros
|
|
|
install_mc_rhel() {
|
|
|
debug "Running: ${FUNCNAME[0]}"
|
|
|
- # Swap in freeworld hardware acceleration separately from the RPM
|
|
|
- install_mesa_freeworld
|
|
|
install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_RPM"
|
|
|
}
|
|
|
|
|
@@ -1587,33 +1585,28 @@ update() {
|
|
|
# Check if we're in a git directory and if it's the installJRMC repository
|
|
|
if git -C "$SCRIPT_DIR" rev-parse --is-inside-work-tree &>/dev/null \
|
|
|
&& [[ "$(git -C "$SCRIPT_DIR" config --get remote.origin.url)" == *"installJRMC"* ]]; then
|
|
|
- debug "installJRMC git repository detected. Running git pull"
|
|
|
|
|
|
# Get the current commit hash
|
|
|
local before_pull_hash after_pull_hash
|
|
|
before_pull_hash=$(git -C "$SCRIPT_DIR" rev-parse HEAD)
|
|
|
|
|
|
- # Stash any local changes
|
|
|
- execute git -C "$SCRIPT_DIR" stash --quiet
|
|
|
-
|
|
|
- # Pull the latest changes
|
|
|
- debug "Executing git pull in $SCRIPT_DIR"
|
|
|
- if git -C "$SCRIPT_DIR" pull | grep -q "Already up to date"; then
|
|
|
- debug "No updates found in git repository."
|
|
|
- return 0
|
|
|
- fi
|
|
|
-
|
|
|
- # Get the new commit hash after pull
|
|
|
- after_pull_hash=$(git -C "$SCRIPT_DIR" rev-parse HEAD)
|
|
|
-
|
|
|
- # If the commit hash has changed, an update occurred
|
|
|
- if [[ "$before_pull_hash" != "$after_pull_hash" ]]; then
|
|
|
- echo "Detected installJRMC update, restarting"
|
|
|
- exec "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
- else
|
|
|
- debug "Git pull did not change the commit hash. No update applied."
|
|
|
- return 0
|
|
|
+ # Stash local changes before pull
|
|
|
+ execute git -C "$SCRIPT_DIR" stash push --quiet
|
|
|
+
|
|
|
+ # Pull latest changes
|
|
|
+ debug "Running git pull in $SCRIPT_DIR"
|
|
|
+ if ! git -C "$SCRIPT_DIR" pull | grep -q "Already up to date"; then
|
|
|
+ # Get the new commit hash after pull
|
|
|
+ after_pull_hash=$(git -C "$SCRIPT_DIR" rev-parse HEAD)
|
|
|
+
|
|
|
+ # If the commit hash has changed, an update occurred
|
|
|
+ if [[ "$before_pull_hash" != "$after_pull_hash" ]]; then
|
|
|
+ echo "Detected installJRMC update, restarting"
|
|
|
+ execute git -C "$SCRIPT_DIR" stash pop --quiet
|
|
|
+ exec "$SCRIPT_PATH" "$@" "--no-update"
|
|
|
+ fi
|
|
|
fi
|
|
|
+ execute git -C "$SCRIPT_DIR" stash pop --quiet
|
|
|
else
|
|
|
debug "Not in a git repository or not the installJRMC repository. Checking for updates via download."
|
|
|
|