diff --git a/README.md b/README.md index 80af9c0..8c437f7 100755 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $ installJRMC --help --compat Build/install MC without minimum dependency version requirements --mcversion VERSION - Build or install a specific MC version, ex. "31.0.12" (default: latest version) + Build or install a specific MC version, ex. "31.0.13" (default: latest version) --arch ARCH Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) --outputdir PATH @@ -112,9 +112,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 31.0.12` +* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 31.0.13` - Build and install an MC 31.0.12 comptability RPM locally and activate it using the `/path/to/license.mjr` + Build and install an MC 31.0.13 comptability RPM locally and activate it using the `/path/to/license.mjr` * `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user` diff --git a/forum.bbcode b/forum.bbcode index fe0b6a1..1f07ddc 100644 --- a/forum.bbcode +++ b/forum.bbcode @@ -27,7 +27,7 @@ $ installJRMC --help --compat Build/install MC without minimum dependency version requirements --mcversion VERSION - Build or install a specific MC version, ex. "31.0.12" + Build or install a specific MC version, ex. "31.0.13" --arch ARCH Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) --outputdir PATH @@ -106,8 +106,8 @@ Install the latest version of MC from the best available repository. 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 31.0.12[/code] -Build and install an MC 31.0.12 comptability RPM locally and activate it using the /path/to/license.mjr +[code]installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 31.0.13[/code] +Build and install an MC 31.0.13 comptability RPM locally and activate it using the /path/to/license.mjr [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] diff --git a/installJRMC b/installJRMC index 5dc50a0..0ec1b34 100755 --- a/installJRMC +++ b/installJRMC @@ -19,7 +19,7 @@ shopt -s extglob declare -g SCRIPTVERSION="1.0-dev" declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,80.0.html" # MC31 declare -g DEBIANBASE="bullseye" -declare -g MC_VERSION_HARDCODE="31.0.12" +declare -g MC_VERSION_HARDCODE="31.0.13" printHelp() { debug "Running: ${FUNCNAME[0]}" @@ -40,7 +40,7 @@ printHelp() { --compat Build/install MC locally without minimum dependency version requirements --mcversion VERSION - Specify the MC version, ex. "31.0.12" (default: latest version) + Specify the MC version, ex. "31.0.13" (default: latest version) --arch VERSION Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) --outputdir PATH @@ -404,26 +404,29 @@ setMCVersion() { [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then MC_VERSION_SOURCE="user input" # Containerized package manager - elif installPackage --silent buildah && - hash buildah &>/dev/null && - cnt=$(buildah from --quiet debian:$DEBIANBASE-slim) &>/dev/null && - buildah run "$cnt" -- bash -c \ - "echo 'deb [trusted=no arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $DEBIANBASE main' > /etc/apt/sources.list 2>&1" &>/dev/null && - buildah run "$cnt" -- bash -c \ - "apt update --allow-insecure-repositories &>/dev/null" &>/dev/null && - MC_VERSION=$(buildah run "$cnt" -- apt-cache policy mediacenter?? | grep Candidate | awk '{print $2}' | sort -V | tail -n1) &>/dev/null && - [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then - MC_VERSION_SOURCE="containerized package manager" - buildah rm "$cnt" &>/dev/null - # Webscrape - elif installPackage wget && MC_VERSION=$(wget -qO- "$BOARDURL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) && - [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then - MC_VERSION_SOURCE="webscrape" - # Hardcoded else - declare -g MC_VERSION="$MC_VERSION_HARDCODE" - MC_VERSION_SOURCE="hardcoded or MC_VERSION env" - err "Warning! Using hardcoded version number" + echo "Determining latest MC version" + if installPackage --silent buildah && + hash buildah &>/dev/null && + cnt=$(buildah from --quiet debian:$DEBIANBASE-slim) &>/dev/null && + buildah run "$cnt" -- bash -c \ + "echo 'deb [trusted=no arch=amd64,i386,armhf,arm64] http://dist.jriver.com/latest/mediacenter/ $DEBIANBASE main' > /etc/apt/sources.list 2>&1" &>/dev/null && + buildah run "$cnt" -- bash -c \ + "apt update --allow-insecure-repositories &>/dev/null" &>/dev/null && + MC_VERSION=$(buildah run "$cnt" -- apt-cache policy mediacenter?? | grep Candidate | awk '{print $2}' | sort -V | tail -n1) &>/dev/null && + [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then + MC_VERSION_SOURCE="containerized package manager" + execute buildah rm "$cnt" + # Webscrape + elif installPackage wget && MC_VERSION=$(wget -qO- "$BOARDURL" | grep -o "[0-9][0-9]\.[0-9]\.[0-9]\+" | head -n 1) && + [[ $MC_VERSION =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then + MC_VERSION_SOURCE="webscrape" + # Hardcoded + else + declare -g MC_VERSION="$MC_VERSION_HARDCODE" + MC_VERSION_SOURCE="hardcoded or MC_VERSION env" + err "Warning! Using hardcoded version number" + fi fi MC_MVERSION="${MC_VERSION%%.*}" @@ -1302,8 +1305,8 @@ service_jriver-mediacenter() { Environment=DISPLAY=$DISPLAY Environment=XAUTHORITY=$XAUTHORITY ExecStart=/usr/bin/mediacenter$MC_MVERSION $* - ExecStop=$MC_STUB_TARGET /MCC 20007 - KillMode=none + KillMode=process + KillSignal=SIGHUP Restart=always RestartSec=10 TimeoutStopSec=30 @@ -1780,14 +1783,14 @@ main() { if (( REPO_INSTALL_SWITCH )); then echo "Installing JRiver Media Center from remote repository" if installMCFromRepo; then - echo "JRiver Media Center installed successfully from repo" + echo "JRiver Media Center installed successfully from remote repository" symlinkCerts migrateLibrary restoreLicense openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp" disableCoW else - err "JRiver Media Center installation from repo failed" + err "JRiver Media Center installation from remote repository failed" return 1 fi fi