Compare commits
3 Commits
8ccf037f25
...
01d8448a91
| Author | SHA1 | Date | |
|---|---|---|---|
| 01d8448a91 | |||
| f2c56eb9f9 | |||
| bf1197cba7 |
12
README.md
12
README.md
@@ -8,7 +8,11 @@ You can always find the latest version of installJRMC, changelog, and documentat
|
||||
|
||||
`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
|
||||
|
||||
@@ -23,7 +27,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum dependency version requirements
|
||||
--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
|
||||
Specify the MC repository, ex. "bullseye", "bookworm", "noble", etc (default: latest official)
|
||||
--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.
|
||||
|
||||
* `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`
|
||||
|
||||
|
||||
74
installJRMC
74
installJRMC
@@ -16,9 +16,9 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
declare -g SCRIPTVERSION="1.1.0"
|
||||
declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,83.0.html" # MC32
|
||||
declare -g MC_VERSION="32.0.45" # Do find all replace
|
||||
declare -g SCRIPTVERSION="1.2.0"
|
||||
declare -g BOARDURL="https://yabb.jriver.com/interact/index.php/board,86.0.html" # MC33
|
||||
declare -g MC_VERSION="33.0.13" # Do find all replace
|
||||
declare -g MC_REPO="bullseye" # should match the MC_VERSION
|
||||
|
||||
printHelp() {
|
||||
@@ -277,7 +277,7 @@ parseInput() {
|
||||
declare -g HOME; HOME=$(getent passwd "$USER" | cut -d: -f6)
|
||||
|
||||
if [[ $# -eq 0 ]] ||
|
||||
[[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes )$ ]] &&
|
||||
[[ $# -eq 1 && " $1 " =~ ^( --debug | -d | -y | --yes | --auto )$ ]] &&
|
||||
[[ $ID != "unknown" ]]; then
|
||||
REPO_INSTALL_SWITCH=1
|
||||
elif [[ $# -eq 1 && " $1 " =~ ^( --compat )$ ]]; then
|
||||
@@ -459,6 +459,9 @@ setMCVersion() {
|
||||
2[7-9]|30)
|
||||
MC_REPO="buster"
|
||||
;;
|
||||
3[1-3])
|
||||
MC_REPO="bullseye"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
@@ -697,13 +700,13 @@ acquireDeb() {
|
||||
fi
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
echo "Found!"
|
||||
else
|
||||
@@ -1240,19 +1243,19 @@ setVNCPass() {
|
||||
setDisplayVars() {
|
||||
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
|
||||
DISPLAY="${USER_DISPLAY:-${DISPLAY:-:0}}"
|
||||
DISPLAYNUM="${DISPLAY#*:}" # strip prefix
|
||||
DISPLAYNUM="${DISPLAYNUM%%.*}" # strip suffix
|
||||
THIS_DISPLAY="${USER_DISPLAY:-${DISPLAY:-:0}}"
|
||||
THIS_DISPLAY_NUM="${THIS_DISPLAY#*:}" # strip prefix
|
||||
THIS_DISPLAY_NUM="${THIS_DISPLAY_NUM%%.*}" # strip suffix
|
||||
# Increment each time we run this
|
||||
if (( NEXT_DISPLAYNUM )); then
|
||||
declare -g NEXT_DISPLAYNUM=$(( NEXT_DISPLAYNUM + 1 ))
|
||||
if (( NEXT_DISPLAY_NUM )); then
|
||||
declare -g NEXT_DISPLAY_NUM=$(( NEXT_DISPLAY_NUM + 1 ))
|
||||
else
|
||||
declare -g NEXT_DISPLAYNUM=$(( DISPLAYNUM + 1 ))
|
||||
declare -g NEXT_DISPLAY_NUM=$(( THIS_DISPLAY_NUM + 1 ))
|
||||
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
|
||||
case $ID in
|
||||
ubuntu|debian)
|
||||
DISPLAY_STRING="Environment=XAUTHORITY=$XAUTHORITY"
|
||||
DISPLAY_STRING="Environment=XAUTHORITY=${XAUTHORITY:-$(echo /run/user/"$(id -u)"/.mutter*)}"
|
||||
;;
|
||||
*)
|
||||
DISPLAY_STRING=""
|
||||
@@ -1340,7 +1343,7 @@ service_jriver-mediacenter() {
|
||||
Type=simple
|
||||
$USER_STRING
|
||||
$DISPLAY_STRING
|
||||
Environment=DISPLAY=$DISPLAY
|
||||
Environment=DISPLAY=$THIS_DISPLAY
|
||||
ExecStart=/usr/bin/mediacenter$MC_MVERSION $*
|
||||
KillMode=none
|
||||
ExecStop=$MC_STUB_TARGET /MCC 20007
|
||||
@@ -1381,7 +1384,7 @@ service_jriver-xvnc() {
|
||||
setServiceVars "${FUNCNAME[0]##*_}" "system"
|
||||
setDisplayVars
|
||||
declare -a start_cmd
|
||||
declare -g PORT=$(( NEXT_DISPLAYNUM + 5900 ))
|
||||
declare -g PORT=$(( NEXT_DISPLAY_NUM + 5900 ))
|
||||
|
||||
installPackage tigervnc-server
|
||||
|
||||
@@ -1428,8 +1431,8 @@ service_jriver-xvnc() {
|
||||
if ! "${ENABLE[@]}" "$SERVICE_NAME"; then
|
||||
err "vncserver failed to start on DISPLAY $NEXT_DISPLAY"
|
||||
# Allow to increment 10 times before breaking
|
||||
max=$(( DISPLAYNUM + 10 ))
|
||||
while [[ $NEXT_DISPLAYNUM -lt $max ]]; do
|
||||
max=$(( THIS_DISPLAY_NUM + 10 ))
|
||||
while [[ $NEXT_DISPLAY_NUM -lt $max ]]; do
|
||||
echo "Incrementing DISPLAY and retrying"
|
||||
service_jriver-xvnc && return
|
||||
done
|
||||
@@ -1453,7 +1456,7 @@ service_jriver-x11vnc() {
|
||||
setDisplayVars
|
||||
|
||||
declare -a start_cmd
|
||||
declare -g PORT=$(( DISPLAYNUM + 5900 ))
|
||||
declare -g PORT=$(( THIS_DISPLAY_NUM + 5900 ))
|
||||
|
||||
installPackage x11vnc
|
||||
|
||||
@@ -1663,20 +1666,20 @@ disableCoW() {
|
||||
#######################################
|
||||
# Migrate major versions
|
||||
#######################################
|
||||
migrateLibrary() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
# migrateLibrary() {
|
||||
# debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
declare mc_user_path="$HOME/.jriver"
|
||||
declare current_config_path="$mc_user_path/Media Center $MC_MVERSION"
|
||||
declare previous_config_path="$mc_user_path/Media Center $(( MC_MVERSION - 1 ))"
|
||||
# declare mc_user_path="$HOME/.jriver"
|
||||
# declare current_config_path="$mc_user_path/Media Center $MC_MVERSION"
|
||||
# declare previous_config_path="$mc_user_path/Media Center $(( MC_MVERSION - 1 ))"
|
||||
|
||||
if [[ ! -d $current_config_path ]] &&
|
||||
[[ -d $previous_config_path ]] &&
|
||||
mkdir -p "$current_config_path"; then
|
||||
echo "Migrating $previous_config_path to $current_config_path"
|
||||
cp -fa "$previous_config_path"/* "$current_config_path"
|
||||
fi
|
||||
}
|
||||
# if [[ ! -d $current_config_path ]] &&
|
||||
# [[ -d $previous_config_path ]] &&
|
||||
# mkdir -p "$current_config_path"; then
|
||||
# echo "Migrating $previous_config_path to $current_config_path"
|
||||
# cp -fa "$previous_config_path"/* "$current_config_path"
|
||||
# fi
|
||||
# }
|
||||
|
||||
|
||||
#######################################
|
||||
@@ -1822,7 +1825,7 @@ main() {
|
||||
if installMCFromRepo; then
|
||||
echo "JRiver Media Center installed successfully from remote repository"
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
# migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
|
||||
disableCoW
|
||||
@@ -1852,7 +1855,7 @@ main() {
|
||||
return 1
|
||||
fi
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
# migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter" "52100-52200/tcp" "1900/udp"
|
||||
disableCoW
|
||||
@@ -1897,3 +1900,4 @@ main() {
|
||||
[[ " $* " =~ ( --debug | -d ) ]] && declare -g DEBUG=1
|
||||
|
||||
main "$@"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user