Compare commits
5 Commits
5104de1b6d
...
f07dfa9ece
| Author | SHA1 | Date | |
|---|---|---|---|
| f07dfa9ece | |||
| 3eb19ea96b | |||
| 9b9af30306 | |||
| 170902ea0b | |||
| 260fcaa1c0 |
@@ -31,7 +31,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum dependency version requirements.
|
||||
--mcversion VERSION
|
||||
Specify the MC version, ex. "33", "35.0.37", or "35.0.37-1" (default: latest).
|
||||
Specify the MC version, ex. "33", "35.0.39", or "35.0.39-1" (default: latest).
|
||||
--arch ARCH
|
||||
Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture).
|
||||
--mcrepo REPO
|
||||
@@ -126,8 +126,8 @@ Install the latest version of MC33 from the best available repository with debug
|
||||
Install a more widely-compatible version of the latest MC version.
|
||||
[code]installJRMC --install repo --service jriver-mediacenter --service-type user[/code]
|
||||
Install MC from the repository and start/enable jriver-mediacenter.service as a user service.
|
||||
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.37[/code]
|
||||
Build and install an MC 35.0.37 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
||||
[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.39[/code]
|
||||
Build and install an MC 35.0.39 comptability RPM locally and activate it using the [tt]/path/to/license.mjr[/tt].
|
||||
[code]installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
||||
Build an RPM locally for the current distro, move it to the webroot, and run createrepo as www-user.
|
||||
[code]installJRMC --service jriver-createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user[/code]
|
||||
|
||||
@@ -28,7 +28,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum dependency version requirements.
|
||||
--mcversion VERSION
|
||||
Build or install a specific MC version, ex. "35.0.37" or "33" (default: latest).
|
||||
Build or install a specific MC version, ex. "35.0.39" or "33" (default: latest).
|
||||
--mcrepo REPO
|
||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official).
|
||||
--arch ARCH
|
||||
@@ -130,9 +130,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 35.0.37`
|
||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.39`
|
||||
|
||||
Build and install an MC 35.0.37 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
||||
Build and install an MC 35.0.39 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
|
||||
|
||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||
|
||||
|
||||
64
installJRMC
64
installJRMC
@@ -21,8 +21,8 @@
|
||||
# shellcheck disable=SC2329
|
||||
shopt -s extglob
|
||||
|
||||
declare -g SCRIPT_VERSION="1.35.9"
|
||||
declare -g MC_VERSION_HARDCODE="35.0.37" # do find all replace
|
||||
declare -g SCRIPT_VERSION="1.35.10"
|
||||
declare -g MC_VERSION_HARDCODE="35.0.39" # do find all replace
|
||||
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 -gi SELF_UPDATE_SWITCH=1 # 0 to disable installJRMC self-update
|
||||
@@ -244,7 +244,7 @@ init() {
|
||||
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
|
||||
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||
declare -g CREATEREPO_USER="$USER" # can be root
|
||||
declare -g ID VERSION_ID UBUNTU_CODENAME 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 -ga PKG_INSTALL PKG_REMOVE PKG_UPDATE PKG_QUERY
|
||||
declare -ga SERVICES CONTAINERS
|
||||
@@ -387,7 +387,7 @@ init() {
|
||||
# Set default targets
|
||||
BUILD_TARGET="${BUILD_TARGET:-$ID}"
|
||||
CREATEREPO_TARGET="${CREATEREPO_TARGET:-$ID}"
|
||||
MC_REPO="${MC_REPO_USER:-${UBUNTU_CODENAME:-$MC_REPO_HARDCODE}}" # user>host>hardcoded
|
||||
MC_REPO="${MC_REPO_USER:-${UBUNTU_CODENAME:-${VERSION_CODENAME:-$MC_REPO_HARDCODE}}}" # user>host>hardcoded
|
||||
|
||||
echo "MC source -> target: $MC_REPO $MC_ARCH -> $BUILD_TARGET $ARCH"
|
||||
set_mc_version
|
||||
@@ -601,7 +601,7 @@ install_external_repos() {
|
||||
}
|
||||
|
||||
# @description Installs host-specific temporary legacy repo for missing dependencies
|
||||
install_legacy_repo() {
|
||||
add_legacy_repo() {
|
||||
debug "${FUNCNAME[0]}()"
|
||||
local repo_name repo_uri repo_suite repo_key temp_repo_file
|
||||
|
||||
@@ -641,6 +641,12 @@ install_legacy_repo() {
|
||||
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
|
||||
acquire_deb() {
|
||||
debug "${FUNCNAME[0]}()"
|
||||
@@ -1018,8 +1024,8 @@ install_mc_deb() {
|
||||
fi
|
||||
|
||||
# Add older repository for libwebkit2gtk-4.0-37, etc, on newer Debian/Ubuntu
|
||||
install_legacy_repo
|
||||
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
|
||||
add_legacy_repo
|
||||
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; remove_legacy_repo; return 1; }
|
||||
|
||||
# Copy the DEB to a temporary file so _apt can read it
|
||||
debug "Creating temporary deb file owned by _apt"
|
||||
@@ -1036,6 +1042,7 @@ install_mc_deb() {
|
||||
--reinstall \
|
||||
"$temp_deb"; then
|
||||
err "Local MC DEB installation failed"
|
||||
remove_legacy_repo
|
||||
execute sudo rm -f "$temp_deb"
|
||||
if ask_ok "Remove source DEB and retry?"; then
|
||||
execute sudo rm -f "$MC_DEB"
|
||||
@@ -1043,6 +1050,7 @@ install_mc_deb() {
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
remove_legacy_repo
|
||||
execute sudo rm -f "$temp_deb"
|
||||
return 0
|
||||
}
|
||||
@@ -1587,16 +1595,6 @@ uninstall() {
|
||||
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"
|
||||
for service in jriver-mediacenter jriver-xvnc jriver-x11vnc; do
|
||||
if command -v firewall-cmd &>/dev/null; then
|
||||
@@ -1619,6 +1617,16 @@ uninstall() {
|
||||
err "Could not remove Media Center package"
|
||||
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"
|
||||
if [[ -f $keyfile ]]; then
|
||||
echo "Removing the JRiver Media Center GPG key"
|
||||
@@ -1794,9 +1802,11 @@ main() {
|
||||
repo_file="/etc/apt/sources.list.d/jriver.sources"
|
||||
fi
|
||||
|
||||
echo "Installing JRiver Media Center GPG key"
|
||||
download "https://dist.jriver.com/mediacenter@jriver.com.gpg.key" "-" |
|
||||
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
|
||||
|
||||
echo "Installing repository file: $repo_file"
|
||||
if [[ ($ID == "ubuntu" && $UBUNTU_CODENAME =~ ^[j-z]) ||
|
||||
($ID == "debian" && ${VERSION_ID%%.*} -ge 12) ]]; then
|
||||
sudo tee "$repo_file" &>/dev/null <<-EOF
|
||||
Types: deb
|
||||
URIs: https://dist.jriver.com/$channel/mediacenter/
|
||||
@@ -1805,16 +1815,8 @@ main() {
|
||||
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"
|
||||
download "https://dist.jriver.com/mediacenter@jriver.com.gpg.key" "-" |
|
||||
gpg --dearmor | sudo tee "$keyfile" &>/dev/null
|
||||
install_legacy_repo
|
||||
add_legacy_repo
|
||||
;;
|
||||
*)
|
||||
err "An MC repository for $ID is not yet available"
|
||||
@@ -1826,7 +1828,7 @@ main() {
|
||||
echo "Updating package lists"
|
||||
if ! execute "${PKG_UPDATE[@]}"; then
|
||||
err "Package update failed!"
|
||||
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
||||
remove_legacy_repo
|
||||
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]]; then
|
||||
echo "Rerunning installJRMC with --mcrepo=$MC_REPO_HARDCODE"
|
||||
rerun "$@" "--mcrepo=$MC_REPO_HARDCODE"
|
||||
@@ -1837,12 +1839,12 @@ main() {
|
||||
echo "Installing $MC_PKG package"
|
||||
if ! install_package --no-install-check --no-gpg-check --allow-downgrades "$MC_PKG"; then
|
||||
err "MC package install failed!"
|
||||
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
||||
remove_legacy_repo
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Clean up legacy repo after successful install
|
||||
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
|
||||
remove_legacy_repo
|
||||
|
||||
link_ssl_certs
|
||||
restore_license
|
||||
|
||||
Reference in New Issue
Block a user