Optionally rerun installJRMC on repo failure

This commit is contained in:
2025-10-21 18:53:15 -04:00
parent 98a10f2539
commit d86b454be4
2 changed files with 18 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
# installJRMC # installJRMC
Install [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions. Installs [JRiver Media Center](https://www.jriver.com/) and associated services on most Linux distributions.
You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC). You can find the latest version of installJRMC, changelog, and documentation in [my repository](https://git.bryanroessler.com/bryan/installJRMC).

View File

@@ -21,7 +21,7 @@
# shellcheck disable=SC2329 # shellcheck disable=SC2329
shopt -s extglob shopt -s extglob
declare -g SCRIPT_VERSION="1.34.9" declare -g SCRIPT_VERSION="1.34.10-dev"
declare -g MC_VERSION_HARDCODE="34.0.71" # do find all replace declare -g MC_VERSION_HARDCODE="34.0.71" # 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="89.0" # MC34 board ID for automatic version detection declare -g BOARD_ID="89.0" # MC34 board ID for automatic version detection
@@ -698,7 +698,19 @@ install_mc_repo() {
err "Failed to add temporary repository" err "Failed to add temporary repository"
return 1 return 1
fi fi
execute "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; }
# Update package lists
if ! execute "${PKG_UPDATE[@]}"; then
error=$?
err "Package update failed!"
if [[ $error -eq 100 ]]; then
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"
fi
fi
return 1
fi
echo "Installing $MC_PKG package" echo "Installing $MC_PKG package"
if ! install_package \ if ! install_package \
@@ -1115,7 +1127,7 @@ install_mc_deb() {
--reinstall \ --reinstall \
"$temp_deb"; then "$temp_deb"; then
err "Local MC DEB installation failed" err "Local MC DEB installation failed"
if ask_ok "Remove source DEB and retry"; then if ask_ok "Remove source DEB and retry?"; then
execute sudo rm -f "$MC_DEB" "$temp_deb" execute sudo rm -f "$MC_DEB" "$temp_deb"
exec "$SCRIPT_PATH" "$@" "--no-update" exec "$SCRIPT_PATH" "$@" "--no-update"
fi fi
@@ -1651,7 +1663,7 @@ uninstall() {
debug "${FUNCNAME[0]}()" debug "${FUNCNAME[0]}()"
local service type unit f local service type unit f
if ! ask_ok "Do you really want to uninstall JRiver Media Center?"; then if ! ask_ok "Uninstall JRiver Media Center, services, and firewall rules?"; then
echo "Uninstall cancelled" echo "Uninstall cancelled"
return 1 return 1
fi fi
@@ -1856,7 +1868,7 @@ main() {
if ((REPO_INSTALL_SWITCH)); then if ((REPO_INSTALL_SWITCH)); then
echo "Installing JRiver Media Center from remote repository" echo "Installing JRiver Media Center from remote repository"
if install_mc_repo; then if install_mc_repo "$@"; then
echo "JRiver Media Center installed successfully from remote repository" echo "JRiver Media Center installed successfully from remote repository"
install_mesa_freeworld install_mesa_freeworld
link_ssl_certs link_ssl_certs