8 Commits

Author SHA1 Message Date
e170a3ade5 1.35.7 release 2026-01-21 06:25:36 -05:00
c3b5660f2b Redownload script on re-exec if piped 2026-01-21 06:23:09 -05:00
eb1a4c76ba Store piped script to intermediate file 2026-01-21 06:19:17 -05:00
d59ff67d59 Run repo fallback automatically 2026-01-21 06:11:40 -05:00
6184ef7cbd Add more debug 2026-01-21 06:07:47 -05:00
776509f038 Add temp debug 2026-01-21 06:05:09 -05:00
19628c7d18 Don't run trap at all for debug 2026-01-21 06:01:29 -05:00
16b6f1e7cd Don't run trap on ERR 2026-01-21 05:57:48 -05:00
3 changed files with 34 additions and 17 deletions

View File

@@ -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.27", or "35.0.27-1" (default: latest).
Specify the MC version, ex. "33", "35.0.37", or "35.0.37-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.27[/code]
Build and install an MC 35.0.27 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.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 --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]

View File

@@ -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.27" or "33" (default: latest).
Build or install a specific MC version, ex. "35.0.37" 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.27`
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 35.0.37`
Build and install an MC 35.0.27 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
Build and install an MC 35.0.37 compatibility RPM locally and activate it using the `/path/to/license.mjr`.
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`

View File

@@ -21,8 +21,8 @@
# shellcheck disable=SC2329
shopt -s extglob
declare -g SCRIPT_VERSION="1.35.6"
declare -g MC_VERSION_HARDCODE="35.0.27" # do find all replace
declare -g SCRIPT_VERSION="1.35.7"
declare -g MC_VERSION_HARDCODE="35.0.37" # 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
@@ -236,6 +236,14 @@ init() {
declare -g USER
declare -g SCRIPT_PATH; SCRIPT_PATH=$(readlink -f "${BASH_SOURCE[0]}")
declare -g SCRIPT_DIR; SCRIPT_DIR=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")
# Detect if script is being piped (SCRIPT_PATH won't be a regular file)
if [[ ! -f $SCRIPT_PATH ]]; then
declare -g SCRIPT_IS_PIPED=1
else
declare -g SCRIPT_IS_PIPED=0
fi
declare -g OUTPUT_DIR="$SCRIPT_DIR/output"
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
declare -g CREATEREPO_USER="$USER" # can be root
@@ -644,9 +652,7 @@ install_legacy_repo() {
Architectures: $MC_ARCH
Signed-By: $repo_key
EOF
# Set a trap to always cleanup legacy repo
# shellcheck disable=SC2064
trap "sudo rm -f $temp_repo_file" EXIT ERR INT
declare -g LEGACY_REPO_FILE="$temp_repo_file"
fi
}
@@ -1048,7 +1054,7 @@ install_mc_deb() {
execute sudo rm -f "$temp_deb"
if ask_ok "Remove source DEB and retry?"; then
execute sudo rm -f "$MC_DEB"
exec "$SCRIPT_PATH" "$@" "--no-update"
exec bash "$SCRIPT_PATH" "$@" "--no-update"
fi
return 1
fi
@@ -1710,7 +1716,7 @@ update() {
# If the commit hash has changed, an update occurred
if [[ "$before_pull_hash" != $(git -C "$SCRIPT_DIR" rev-parse HEAD) ]]; then
echo "Detected installJRMC update, restarting"
exec "$SCRIPT_PATH" "$@" "--no-update"
exec bash "$SCRIPT_PATH" "$@" "--no-update"
fi
else
debug "Not in the installJRMC repository, checking for installJRMC update via webscrape."
@@ -1741,7 +1747,7 @@ update() {
execute rm -f "$tmp"
echo "Detected installJRMC update, restarting"
exec "$SCRIPT_PATH" "$@" "--no-update"
exec bash "$SCRIPT_PATH" "$@" "--no-update"
else
debug "Current installJRMC $SCRIPT_VERSION is the latest version"
execute rm -f "$tmp"
@@ -1837,9 +1843,16 @@ main() {
echo "Updating package lists"
if ! execute "${PKG_UPDATE[@]}"; then
err "Package update failed!"
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]] &&
ask_ok "Re-run installJRMC with --mcrepo=$MC_REPO_HARDCODE?"; then
exec "$SCRIPT_PATH" "$@" "--no-update" "--mcrepo=$MC_REPO_HARDCODE"
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
if [[ $MC_REPO != "$MC_REPO_HARDCODE" ]]; then
echo "Rerunning installJRMC with --mcrepo=$MC_REPO_HARDCODE"
if ((SCRIPT_IS_PIPED)); then
# 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
return 1
fi
@@ -1847,9 +1860,13 @@ 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"
return 1
fi
# Clean up legacy repo after successful install
[[ -n $LEGACY_REPO_FILE ]] && sudo rm -f "$LEGACY_REPO_FILE"
link_ssl_certs
restore_license
open_firewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"