3 Commits

Author SHA1 Message Date
01d8448a91 Prep for MC33 release 2024-08-22 15:28:49 -04:00
f2c56eb9f9 Automatic XAuthority fallback 2024-05-29 16:36:40 -04:00
bf1197cba7 Improve display variable naming 2024-05-29 16:10:20 -04:00
2 changed files with 48 additions and 40 deletions

View File

@@ -8,7 +8,11 @@ You can always find the latest version of installJRMC, changelog, and documentat
`installJRMC [--option [ARGUMENT]]` `installJRMC [--option [ARGUMENT]]`
Running `installJRMC` without any options will install the latest version of JRiver Media Center (MC) from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager (`--install repo`). If any other option is passed, then the default install method (i.e. `--install repo` or `--install local`) must be specified. This makes it possible to install services and containers independent of MC. Running `installJRMC` without any options will install the latest version of JRiver Media Center (MC) from the official JRiver repository (Ubuntu/Debian) or my [unofficial repository](https://repos.bryanroessler.com/jriver/) (Fedora/CentOS) using the system package manager (`--install repo`). If any other option is passed, then the default install method (i.e. `--install repo` or `--install local`) must be specified. This makes it possible to install services and containers independent of MC.>
## tl;dr
`curl https://git.bryanroessler.com/bryan/installJRMC/raw/master/installJRMC|bash`
## Options ## Options
@@ -23,7 +27,7 @@ $ installJRMC --help
--compat --compat
Build/install MC without minimum dependency version requirements Build/install MC without minimum dependency version requirements
--mcversion VERSION --mcversion VERSION
Build or install a specific MC version, ex. "32.0.45" (default: latest version) Build or install a specific MC version, ex. "33.0.13" (default: latest version)
--mcrepo REPO --mcrepo REPO
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official) Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
--arch ARCH --arch ARCH
@@ -114,9 +118,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. 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 32.0.45` * `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 33.0.13`
Build and install an MC 32.0.45 comptability RPM locally and activate it using the `/path/to/license.mjr` Build and install an MC 33.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` * `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`

View File

@@ -16,9 +16,9 @@
shopt -s extglob shopt -s extglob
declare -g SCRIPTVERSION="1.1.0" declare -g SCRIPTVERSION="1.2.0"
declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,83.0.html" # MC32 declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
declare -g MC_VERSION="32.0.45" # Do find all replace declare -g MC_VERSION="33.0.13" # Do find all replace
declare -g MC_REPO="bullseye" # should match the MC_VERSION declare -g MC_REPO="bullseye" # should match the MC_VERSION
printHelp() { printHelp() {
@@ -266,7 +266,7 @@ parseInput() {
declare -ga SERVICES CONTAINERS declare -ga SERVICES CONTAINERS
declare long_opts short_opts input declare long_opts short_opts input
# Defaults # Defaults
declare -g BUILD_TARGET="$ID" declare -g BUILD_TARGET="$ID"
declare -g REPO_TARGET="$ID" declare -g REPO_TARGET="$ID"
declare -g CREATEREPO_USER="$USER" declare -g CREATEREPO_USER="$USER"
@@ -277,7 +277,7 @@ parseInput() {
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6) declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
if [[ $# -eq 0 ]] || if [[ $# -eq 0 ]] ||
[[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes )$ ]] && [[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes | --auto )$ ]] &&
[[ $ID != "unknown" ]]; then [[ $ID != "unknown" ]]; then
REPO_INSTALL_SWITCH=1 REPO_INSTALL_SWITCH=1
elif [[ $# -eq 1 && " $1 " =~ ^( --compat )$ ]]; then elif [[ $# -eq 1 && " $1 " =~ ^( --compat )$ ]]; then
@@ -459,6 +459,9 @@ setMCVersion() {
2[7-9]|30) 2[7-9]|30)
MC_REPO="buster" MC_REPO="buster"
;; ;;
3[1-3])
MC_REPO="bullseye"
;;
esac esac
fi fi
@@ -697,13 +700,13 @@ acquireDeb() {
fi fi
if [[ -v BETAPASS ]] && if [[ -v BETAPASS ]] &&
echo "Checking beta repo for DEB package" && execute wget -q -O "$MC_DEB" \ echo "Checking beta repo for DEB package" && execute wget --quiet --output-document "$MC_DEB" \
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/MediaCenter-$MC_VERSION-$ARCH.deb"; then "https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/beta/$BETAPASS/MediaCenter-$MC_VERSION-$ARCH.deb"; then
echo "Found!" echo "Found!"
elif echo "Checking latest repo for DEB package" && execute wget -q -O "$MC_DEB" \ elif echo "Checking latest repo for DEB package" && execute wget --quiet --output-document "$MC_DEB" \
"https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/MediaCenter-$MC_VERSION-$ARCH.deb"; then "https://files.jriver-cdn.com/mediacenter/channels/v$MC_MVERSION/latest/MediaCenter-$MC_VERSION-$ARCH.deb"; then
echo "Found!" echo "Found!"
elif echo "Checking test repo for DEB package" && execute wget -q -O "$MC_DEB" \ elif echo "Checking test repo for DEB package" && execute wget --quiet --output-document "$MC_DEB" \
"https://files.jriver-cdn.com/mediacenter/test/MediaCenter-$MC_VERSION-$ARCH.deb"; then "https://files.jriver-cdn.com/mediacenter/test/MediaCenter-$MC_VERSION-$ARCH.deb"; then
echo "Found!" echo "Found!"
else else
@@ -1240,19 +1243,19 @@ setVNCPass() {
setDisplayVars() { setDisplayVars() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
declare -g DISPLAY DISPLAYNUM NEXT_DISPLAY declare -g THIS_DISPLAY THIS_DISPLAY_NUM NEXT_DISPLAY
# Check USER_DISPLAY, else environment DISPLAY, else set to :0 # Check USER_DISPLAY, else environment DISPLAY, else set to :0
DISPLAY="${USER_DISPLAY:-${DISPLAY:-:0}}" THIS_DISPLAY="${USER_DISPLAY:-${DISPLAY:-:0}}"
DISPLAYNUM="${DISPLAY#*:}" # strip prefix THIS_DISPLAY_NUM="${THIS_DISPLAY#*:}" # strip prefix
DISPLAYNUM="${DISPLAYNUM%%.*}" # strip suffix THIS_DISPLAY_NUM="${THIS_DISPLAY_NUM%%.*}" # strip suffix
# Increment each time we run this # Increment each time we run this
if (( NEXT_DISPLAYNUM )); then if (( NEXT_DISPLAY_NUM )); then
declare -g NEXT_DISPLAYNUM=$(( NEXT_DISPLAYNUM + 1 )) declare -g NEXT_DISPLAY_NUM=$(( NEXT_DISPLAY_NUM + 1 ))
else else
declare -g NEXT_DISPLAYNUM=$(( DISPLAYNUM + 1 )) declare -g NEXT_DISPLAY_NUM=$(( THIS_DISPLAY_NUM + 1 ))
fi fi
declare -g NEXT_DISPLAY=":$NEXT_DISPLAYNUM" NEXT_DISPLAY=":$NEXT_DISPLAY_NUM"
} }
@@ -1298,7 +1301,7 @@ setServiceVars() {
# TODO Ubuntu needs these in the service file, fedora (and others?) do not # TODO Ubuntu needs these in the service file, fedora (and others?) do not
case $ID in case $ID in
ubuntu|debian) ubuntu|debian)
DISPLAY_STRING="Environment=XAUTHORITY=$XAUTHORITY" DISPLAY_STRING="Environment=XAUTHORITY=${XAUTHORITY:-$(echo /run/user/"$(id -u)"/.mutter*)}"
;; ;;
*) *)
DISPLAY_STRING="" DISPLAY_STRING=""
@@ -1340,7 +1343,7 @@ service_jriver-mediacenter() {
Type=simple Type=simple
$USER_STRING $USER_STRING
$DISPLAY_STRING $DISPLAY_STRING
Environment=DISPLAY=$DISPLAY Environment=DISPLAY=$THIS_DISPLAY
ExecStart=/usr/bin/mediacenter$MC_MVERSION $* ExecStart=/usr/bin/mediacenter$MC_MVERSION $*
KillMode=none KillMode=none
ExecStop=$MC_STUB_TARGET /MCC 20007 ExecStop=$MC_STUB_TARGET /MCC 20007
@@ -1381,7 +1384,7 @@ service_jriver-xvnc() {
setServiceVars "${FUNCNAME[0]##*_}" "system" setServiceVars "${FUNCNAME[0]##*_}" "system"
setDisplayVars setDisplayVars
declare -a start_cmd declare -a start_cmd
declare -g PORT=$(( NEXT_DISPLAYNUM + 5900 )) declare -g PORT=$(( NEXT_DISPLAY_NUM + 5900 ))
installPackage tigervnc-server installPackage tigervnc-server
@@ -1428,8 +1431,8 @@ service_jriver-xvnc() {
if ! "${ENABLE[@]}" "$SERVICE_NAME"; then if ! "${ENABLE[@]}" "$SERVICE_NAME"; then
err "vncserver failed to start on DISPLAY $NEXT_DISPLAY" err "vncserver failed to start on DISPLAY $NEXT_DISPLAY"
# Allow to increment 10 times before breaking # Allow to increment 10 times before breaking
max=$(( DISPLAYNUM + 10 )) max=$(( THIS_DISPLAY_NUM + 10 ))
while [[ $NEXT_DISPLAYNUM -lt $max ]]; do while [[ $NEXT_DISPLAY_NUM -lt $max ]]; do
echo "Incrementing DISPLAY and retrying" echo "Incrementing DISPLAY and retrying"
service_jriver-xvnc && return service_jriver-xvnc && return
done done
@@ -1453,7 +1456,7 @@ service_jriver-x11vnc() {
setDisplayVars setDisplayVars
declare -a start_cmd declare -a start_cmd
declare -g PORT=$(( DISPLAYNUM + 5900 )) declare -g PORT=$(( THIS_DISPLAY_NUM + 5900 ))
installPackage x11vnc installPackage x11vnc
@@ -1663,20 +1666,20 @@ disableCoW() {
####################################### #######################################
# Migrate major versions # Migrate major versions
####################################### #######################################
migrateLibrary() { # migrateLibrary() {
debug "Running: ${FUNCNAME[0]}" # debug "Running: ${FUNCNAME[0]}"
declare mc_user_path="$HOME/.jriver" # declare mc_user_path="$HOME/.jriver"
declare current_config_path="$mc_user_path/Media Center $MC_MVERSION" # declare current_config_path="$mc_user_path/Media Center $MC_MVERSION"
declare previous_config_path="$mc_user_path/Media Center $(( MC_MVERSION - 1 ))" # declare previous_config_path="$mc_user_path/Media Center $(( MC_MVERSION - 1 ))"
if [[ ! -d $current_config_path ]] && # if [[ ! -d $current_config_path ]] &&
[[ -d $previous_config_path ]] && # [[ -d $previous_config_path ]] &&
mkdir -p "$current_config_path"; then # mkdir -p "$current_config_path"; then
echo "Migrating $previous_config_path to $current_config_path" # echo "Migrating $previous_config_path to $current_config_path"
cp -fa "$previous_config_path"/* "$current_config_path" # cp -fa "$previous_config_path"/* "$current_config_path"
fi # fi
} # }
####################################### #######################################
@@ -1822,7 +1825,7 @@ main() {
if installMCFromRepo; then if installMCFromRepo; then
echo "JRiver Media Center installed successfully from remote repository" echo "JRiver Media Center installed successfully from remote repository"
symlinkCerts symlinkCerts
migrateLibrary # migrateLibrary
restoreLicense restoreLicense
openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp" openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
disableCoW disableCoW
@@ -1852,7 +1855,7 @@ main() {
return 1 return 1
fi fi
symlinkCerts symlinkCerts
migrateLibrary # migrateLibrary
restoreLicense restoreLicense
openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp" openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
disableCoW disableCoW
@@ -1897,3 +1900,4 @@ main() {
[[ " $* " =~ ( --debug | -d ) ]] && declare -g DEBUG=1 [[ " $* " =~ ( --debug | -d ) ]] && declare -g DEBUG=1
main "$@" main "$@"