Compare commits
8 Commits
363f67b425
...
3096f9fda1
| Author | SHA1 | Date | |
|---|---|---|---|
| 3096f9fda1 | |||
| 99894d6798 | |||
| 24f54b0302 | |||
| 06b965f2a2 | |||
| 9c5ce26b57 | |||
| ee154bf79c | |||
| c629846c8e | |||
| 2fbc329f1e |
@@ -29,7 +29,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum dependency version requirements
|
||||
--mcversion VERSION
|
||||
Build or install a specific MC version, ex. "33.0.49" or "33" (default: latest)
|
||||
Build or install a specific MC version, ex. "33.0.61" or "33" (default: latest)
|
||||
--mcrepo REPO
|
||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
||||
--arch ARCH
|
||||
@@ -122,9 +122,9 @@ Multiple services (but not `--service-types`) can be installed at one time using
|
||||
|
||||
Install MC from the repository and start/enable `jriver-mediacenter.service` as a user service.
|
||||
|
||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.49`
|
||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.61`
|
||||
|
||||
Build and install an MC 33.0.49 compatibility RPM locally and activate it using the `/path/to/license.mjr`
|
||||
Build and install an MC 33.0.61 compatibility RPM locally and activate it using the `/path/to/license.mjr`
|
||||
|
||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||
|
||||
|
||||
79
installJRMC
79
installJRMC
@@ -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
|
||||
# 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)
|
||||
|
||||
# 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
|
||||
# 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."
|
||||
|
||||
|
||||
Reference in New Issue
Block a user