From 605dc78cf89a74316ca5a188445006bd232fc013 Mon Sep 17 00:00:00 2001 From: bryan Date: Mon, 2 Jun 2025 15:26:30 -0400 Subject: [PATCH] Cleanup documentation --- README.bbcode | 28 +++++++++++++--------------- README.md | 27 ++++++++++++++++++--------- installJRMC | 36 ++++++++++++++++++------------------ 3 files changed, 49 insertions(+), 42 deletions(-) diff --git a/README.bbcode b/README.bbcode index 76bbd35..d306485 100644 --- a/README.bbcode +++ b/README.bbcode @@ -12,12 +12,11 @@ You can find the latest version of installJRMC, changelog, and documentation in Download and unzip installJRMC from the attachment below or grab the latest stable version directly: [code]curl -O https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC && chmod +x ./installJRMC && -./installJRMC [--option [ARGUMENT]][/code] +./installJRMC [--option [ARGUMENT]] +[/code] -Running [tt]installJRMC[/tt] without any options implies [tt]--install=repo[/tt] (on SUSE/Arch: [tt]--install=local[/tt]) and will install the latest version of JRiver Media Center (MC) from the official JRiver repository (Ubuntu/Debian) or my [url=https://repos.bryanroessler.com/jriver/]unofficial repository[/url] (Fedora/CentOS) using the system package manager. -If [tt]--service[/tt] or [tt]--container[/tt] is passed then --install= must be specified to install MC (allows services and containers to be installed independent of MC). - -Recent versions of installJRMC (>=1.3.0) automatically self-update to the latest installJRMC release. +[tt]installJRMC[/tt] defaults to [tt]--install=repo[/tt] on distros with MC repositories and [tt]--install=local[/tt] on all others. +Specifying [tt]--build[/tt], [tt]--createrepo[/tt], [tt]--service[/tt], or [tt]--uninstall[/tt] disables the default install method. [size=18pt]Options[/size] @@ -32,13 +31,13 @@ $ installJRMC --help --compat Build/install MC without minimum dependency version requirements --mcversion VERSION - Build or install a specific MC version, ex. "34.0.31" or "33" (default: latest) + Specify the MC version, ex. "33", "34.0.31", or "34.0.31-1" (default: latest) --arch ARCH - Specify the MC architecture, ex. "amd64", "arm64", etc (default: host architecture) + Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host architecture) --mcrepo REPO - Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official) + Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: host or official) --outputdir PATH - Generate rpmbuild output in this PATH (default: ./output) + Generate reusable installJRMC output in this PATH (default: ./output) --restorefile RESTOREFILE Restore file location for automatic license registration --betapass PASSWORD @@ -61,7 +60,7 @@ $ installJRMC --help --yes, -y, --auto Always assumes yes for questions --version, -v - Print this script version and exit + Print installJRMC version and exit --debug, -d Print debug output --help, -h @@ -82,15 +81,14 @@ jriver-x11vnc (user) jriver-xvnc (system) Enable and start a new Xvnc session running JRiver Media Center --vncpass PASSWORD - Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or use no password + Set vnc password for x11vnc/Xvnc access. If no password is set, the script will either use existing password stored in ~/.vnc/jrmc_passwd or else no password --display DISPLAY Manually specify display to use for x11vnc/Xvnc (ex. ':1') jriver-createrepo (system) Install hourly service to build latest MC RPM and run createrepo - By default installs as root service to handle www permissions more gracefully [/code] -By default, MC services use a sane [tt]--service-type[/tt] listed next to the service name in the Services description. +Services use a sane default [tt]--service-type[/tt] listed next to the service name in the Services description. User services can be manipulated as an unprivileged user, for example: [tt]systemctl --user stop jriver-mediacenter[/tt] and begin at user login. System services are manipulable as root, for example: [tt]sudo systemctl stop jriver-servicename@username.service[/tt] and begin at system boot. Note that it is possible to run all services of a particular user at boot using [tt][url=https://www.freedesktop.org/software/systemd/man/loginctl.html]sudo loginctl enable-linger username[/url][/tt]. @@ -131,8 +129,8 @@ Install services to share the existing local desktop via VNC and automatically r [code]installJRMC --install repo --service jriver-xvnc --display ":2"[/code] Install an Xvnc server on display ':2' that starts MC. [code]installJRMC --uninstall[/code] -Uninstall MC, services, and firewall rules. This will [b]not[/b] remove your media, media library/database, or library backup folder. +Uninstall MC, services, and firewall rules. This will [b]not[/b] remove your media, media library/database, or library backups. [size=18pt]Additional Info[/size] -Did you find installJRMC useful? [url=https://paypal.me/bryanroessler?locale.x=en_US]Buy me a coffee![/url] \ No newline at end of file +Did you find installJRMC useful? [url=https://paypal.me/bryanroessler]Buy me a coffee![/url] \ No newline at end of file diff --git a/README.md b/README.md index c4eee90..4264b45 100755 --- a/README.md +++ b/README.md @@ -8,11 +8,10 @@ You can find the latest version of installJRMC, changelog, and documentation in `installJRMC [--option [ARGUMENT]]` -Running `installJRMC` without any options implies `--install repo` (on SUSE/Arch: `--install local`) and will install the latest version of Media Center from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager. If `--service` or `--container` is passed then the default installation method (`--install repo` or `--install local`) must be specified (allows services and containers to be installed independent of MC). +`installJRMC` defaults to `--install=repo` on distros with MC repositories and `--install=local` on all others. +Specifying `--build`, `--createrepo`, `--service`, or `--uninstall` disables the default install method. -Recent versions of installJRMC will automatically self-update to the latest installJRMC release. - -## tl;dr +### tl;dr `curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash` @@ -58,7 +57,7 @@ $ installJRMC --help --yes, -y, --auto Always assume yes for questions --version, -v - Print this script version and exit + Print installJRMC version and exit --debug, -d Print debug output --help, -h @@ -85,14 +84,13 @@ jriver-xvnc [--service-type=system] Manually specify display to use for x11vnc/Xvnc (ex. ':1') jriver-createrepo [--service-type=system] Install hourly service to build latest MC RPM and run createrepo - By default installs as root service to handle www permissions more gracefully ``` #### `--service-type=` -By default, MC services use a sane `--service-type` listed next to the service name in the [`--service=`](#--service) section. User services begin at user login and are managed by the unprivileged user, for example: `systemctl --user stop jriver-mediacenter`. System services begin at boot and are managed by root, for example: `sudo systemctl stop jriver-servicename@username.service`. It is possible to run all services of a particular user at boot using [`sudo loginctl enable-linger username`](https://www.freedesktop.org/software/systemd/man/loginctl.html). +Services use a sane default `--service-type` listed next to the service name in the [`--service=`](#--service) section. User services begin at user login and are managed by the unprivileged user, for example: `systemctl --user stop jriver-mediacenter`. System services begin at boot and are managed by root, for example: `sudo systemctl stop jriver-servicename@username.service`. It is possible to run all services of a particular user at boot using [`sudo loginctl enable-linger username`](https://www.freedesktop.org/software/systemd/man/loginctl.html). -Multiple services (but not `--service-types`) can be installed at one time using multiple `--service` blocks: `installJRMC --install repo --service jriver-x11vnc --service jriver-mediacenter` +Multiple services (but not `--service-types`) can be installed at one time using multiple `--service` blocks: `installJRMC --install=repo --service=jriver-x11vnc --service=jriver-mediacenter` #### `jriver-x11vnc` versus `jriver-xvnc` @@ -108,6 +106,17 @@ Multiple services (but not `--service-types`) can be installed at one time using **Note:** `ufw` is not installed by default on Debian but will be installed by `installJRMC`. To prevent SSH lock-out, Debian users that have not already enabled `ufw` will need to `sudo ufw enable` after running `installJRMC` and inspecting their configuration. +## Nicities + +Depending on the distribution, `installJRMC` also performs the following tasks during MC installation: + +* Automatically updates `installJRMC` to the latest release +* Activates external third-party repositories for improved media playback (hardware decoding, etc.) +* Adds temporary legacy repositories to provide deprecated libraries +* Links non-standard SSL certs +* Disables BTRFS CoW for MC database directories +* Activates MC if a valid license file is found in common locations + ## Examples * `installJRMC` @@ -154,4 +163,4 @@ Multiple services (but not `--service-types`) can be installed at one time using Did you find `installJRMC` useful? [Buy me a coffee!](https://paypal.me/bryanroessler) -Did you find a bug? Let me know on [Interact!](https://yabb.jriver.com/interact/index.php/topic,134152.0.html) +Did you find a bug? [Let me know on Interact!](https://yabb.jriver.com/interact/index.php/topic,141168.0.html) diff --git a/installJRMC b/installJRMC index 1058416..39b67dc 100755 --- a/installJRMC +++ b/installJRMC @@ -33,28 +33,32 @@ print_help() { debug "${FUNCNAME[0]}()" cat <<-EOF + SEE: + README.md for more information + USAGE: installJRMC [[OPTION] [VALUE]]... - If no options (excluding -d or --debug) are provided installJRMC defaults to '--install repo'. + installJRMC defaults to --install=repo on platforms with a JRiver repository and --install=local on all others. + Specifying --build, --createrepo, --service, or --uninstall disables the default install method. OPTIONS --install, -i repo|local repo: Install MC from repository, updates are handled by the system package manager - local: Build and install MC package locally from official source release + local: Build and install MC locally from official source package --build[=suse|fedora|centos] Build RPM from source DEB but do not install Optionally, specify a target distro for cross-building (ex. --build=suse, note the '=') --compat Build/install MC locally without minimum dependency version requirements --mcversion VERSION - Specify the MC version, ex. "$MC_VERSION" or "${MC_VERSION%%.*}" + Specify the MC version, ex. "$MC_VERSION" or "${MC_VERSION%%.*}" (default: latest release) --arch VERSION Specify the target MC architecture, ex. "amd64", "arm64", etc (default: host) --mcrepo REPO Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: auto) --outputdir PATH - Generate rpmbuild output in this directory (default: ./output) + Generate reusable installJRMC output in this PATH (default: ./output) --restorefile MJR_FILE Restore file location for automatic license registration --betapass PASSWORD @@ -80,7 +84,7 @@ print_help() { --yes, -y, --auto Assume yes response to questions --version, -v - Print this script version and exit + Print installJRMC version and exit --debug, -d Print debug output --help, -h @@ -99,16 +103,12 @@ print_help() { Enable and start a new Xvnc session running JRiver Media Center --vncpass PASSWORD Set the vnc password for x11vnc/Xvnc access. If no password is set, installJRMC - will either use existing password stored in \$HOME/.vnc/jrmc_passwd or use no password + will either use existing password stored in \$HOME/.vnc/jrmc_passwd or else no password --display DISPLAY Display to use for x11vnc/Xvnc (default: The current display (x11vnc) or the current display incremented by 1 (Xvnc)) jriver-createrepo (system) Install hourly service to build latest MC RPM and run createrepo - - CONTAINERS (TODO: Under construction) - mediacenter-xvnc - createrepo EOF } @@ -134,8 +134,7 @@ parse_input() { eval set -- "$input" while true; do case $1 in - --install|-i) - shift + --install|-i) shift; case $1 in local|rpm|deb) BUILD_SWITCH=1 LOCAL_INSTALL_SWITCH=1 ;; repo|remote) REPO_INSTALL_SWITCH=1 ;; @@ -181,7 +180,7 @@ parse_input() { ;; --arch) shift; USER_ARCH="$1" ;; --mcrepo) shift; USER_MC_REPO="$1" ;; - --restorefile) shift; MJR_FILE="$1" ;; + --restorefile) shift; MJR_FILE="$1"; [[ -f $MJR_FILE ]] || err "Specified license $MJR_FILE missing." ;; --betapass) shift; BETAPASS="$1" ;; --service-type) shift; SERVICE_TYPE="$1" ;; --service|-s|--services) shift; SERVICES+=("$1") ;; @@ -208,10 +207,9 @@ parse_input() { fi # Fallback to default install method in some scenarios - if ! ((UNINSTALL_SWITCH + BUILD_SWITCH + CREATEREPO_SWITCH + - LOCAL_INSTALL_SWITCH + CONTAINER_INSTALL_SWITCH + SNAP_INSTALL_SWITCH + - APPIMAGE_INSTALL_SWITCH)) && - [[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then + if ! ((UNINSTALL_SWITCH || BUILD_SWITCH || CREATEREPO_SWITCH || LOCAL_INSTALL_SWITCH + || CONTAINER_INSTALL_SWITCH || SNAP_INSTALL_SWITCH || APPIMAGE_INSTALL_SWITCH)) && + [[ ${#SERVICES[@]} -eq 0 && ${#CONTAINERS[@]} -eq 0 ]]; then debug "Defaulting to --install=repo" REPO_INSTALL_SWITCH=1 fi @@ -1198,7 +1196,9 @@ restore_license() { for f in "$MJR_FILE" "$newest"; do if [[ -f $f ]]; then - execute "mediacenter$MC_MVERSION" "/RestoreFromFile" "$f" + if execute "mediacenter$MC_MVERSION" "/RestoreFromFile" "$f"; then + return 0 + fi fi done fi