diff --git a/installJRMC b/installJRMC index 6b8428c..b5f0f9a 100755 --- a/installJRMC +++ b/installJRMC @@ -561,7 +561,7 @@ EOF ####################################### # Installs JRiver Media Center from a repository # Returns: - # 0 if JRiver Media Center installed sucessfully, 1 if installation failed + # 0 if JRiver Media Center installed sucessfully ####################################### _installMCFromRepo() { @@ -581,19 +581,30 @@ EOF' local _mcpkg="MediaCenter" elif [[ "$ID" =~ ^(ubuntu|debian)$ ]]; then wget -q "http://dist.jriver.com/mediacenter@jriver.com.gpg.key" -O- | _ifSudo apt-key add - > /dev/null 2>&1 - _ifSudo wget "http://dist.jriver.com/latest/mediacenter/mediacenter$_mversion.list" -O "/etc/apt/sources.list.d/jriver.list" > /dev/null 2>&1 + _bash_cmd 'cat <<-EOF > /etc/apt/sources.list.d/jriver.list +deb [arch=amd64,i386,armhf] http://dist.jriver.com/latest/mediacenter/ jessie main +EOF' local _mcpkg="mediacenter$_mversion" fi # Update packages and install JRiver MediaCenter - if _pkg_update > /dev/null 2>&1 && _pkg_install "$_mcpkg" > /dev/null 2>&1; then + if [[ -n $_debug ]]; then + _pkg_update && \ + _pkg_install "$_mcpkg" + else + _pkg_update > /dev/null 2>&1 && \ + _pkg_install "$_mcpkg" > /dev/null 2>&1 + fi + + # shellcheck disable=SC2181 + # Rationale: More compact to check this once + if [[ $? -eq 0 ]]; then echo "JRiver Media Center installed successfully!" return 0 else err "JRiver Media Center installation failed!" - return 1 + exit 1 fi - }