Compare commits
4 Commits
1c837f7dbb
...
7c0372ed1b
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c0372ed1b | |||
| 88fa2bdd52 | |||
| 8f9dc1a7a4 | |||
| 1e8b753380 |
@@ -8,7 +8,7 @@ This program will install [JRiver Media Center](https://www.jriver.com/) (JRMC)
|
||||
|
||||
Running `installJRMC` without any options will install the latest version of JRiver 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 (`--install repo`). If any other option is specified, then the default install method (i.e. `--install repo` or `--install local`) will need to be explicitly specified. This makes it possible to install services and containers independent of MC.
|
||||
|
||||
**Note**: `installJRMC` does not perform library migrations. Before moving to a new major version (i.e. v27->v28), you should first [perform a library backup](https://wiki.jriver.com/index.php/Library_Backup), install the new major version, and then [restore the library](https://wiki.jriver.com/index.php/Restore_a_library).
|
||||
**Note**: `installJRMC` does not perform library migrations. Before moving to a new major version (i.e. v28->v29), you should first [perform a library backup](https://wiki.jriver.com/index.php/Library_Backup), install the new major version, and then [restore the library](https://wiki.jriver.com/index.php/Restore_a_library).
|
||||
|
||||
## Options
|
||||
|
||||
@@ -23,7 +23,7 @@ $ installJRMC --help
|
||||
--compat
|
||||
Build/install MC without minimum library specifiers
|
||||
--mcversion VERSION
|
||||
Build or install a specific MC version, ex. "28.0.100"
|
||||
Build or install a specific MC version, ex. "29.0.18"
|
||||
--outputdir PATH
|
||||
Generate rpmbuild output in this PATH (Default: ./output)
|
||||
--restorefile RESTOREFILE
|
||||
@@ -110,9 +110,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 28.0.100`
|
||||
* `installJRMC --install local --compat --restorefile /path/to/license.mjr --mcversion 29.0.18`
|
||||
|
||||
Build and install an MC 28.0.100 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
||||
Build and install an MC 29.0.18 comptability RPM locally and activate it using the `/path/to/license.mjr`
|
||||
|
||||
* `installJRMC --createrepo --createrepo-webroot /srv/jriver/repo --createrepo-user www-user`
|
||||
|
||||
|
||||
34
installJRMC
34
installJRMC
@@ -18,7 +18,7 @@
|
||||
|
||||
shopt -s extglob
|
||||
|
||||
declare -g SCRIPTVERSION="1.0b12"
|
||||
declare -g SCRIPTVERSION="1.0b13"
|
||||
declare -g OUTPUTDIR="$PWD/output"
|
||||
declare -g CREATEREPO_WEBROOT="/var/www/jriver"
|
||||
declare -g USER="${SUDO_USER:-$USER}"
|
||||
@@ -43,7 +43,7 @@ printHelp() {
|
||||
--compat
|
||||
Build/install MC locally without minimum library specifiers
|
||||
--mcversion VERSION
|
||||
Specify the MC version, ex. "28.0.100" (Default: latest)
|
||||
Specify the MC version, ex. "29.0.18" (Default: latest)
|
||||
--outputdir PATH
|
||||
Generate rpmbuild output in this directory (Default: ./output)
|
||||
--restorefile RESTOREFILE
|
||||
@@ -241,7 +241,7 @@ getVersion() {
|
||||
|
||||
declare -g MCVERSION VERSION_SOURCE MVERSION MCPKG BASE="buster" # For container method
|
||||
#declare -g BASE_NEXT="bullseye" # TODO possibly use for fallback to smooth upgrades
|
||||
declare boardurl="https://yabb.jriver.com/interact/index.php/board,71.0.html" # MC28 (Buster), for fallback webscrape
|
||||
declare boardurl="https://yabb.jriver.com/interact/index.php/board,74.0.html" # MC28 (Buster), for fallback webscrape
|
||||
|
||||
# User input
|
||||
if [[ -v MCVERSION && "$MCVERSION" =~ ([0-9]+.[0-9]+.[0-9]+) ]]; then
|
||||
@@ -263,7 +263,7 @@ getVersion() {
|
||||
VERSION_SOURCE="webscrape"
|
||||
# Hardcoded
|
||||
else
|
||||
MCVERSION="28.0.106"
|
||||
MCVERSION="29.0.18"
|
||||
VERSION_SOURCE="hardcoded version"
|
||||
err "Warning! Using hardcoded version number"
|
||||
fi
|
||||
@@ -1379,10 +1379,9 @@ getOS() {
|
||||
disableCoW() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
declare dir
|
||||
declare mc_system_path="/usr/lib/jriver"
|
||||
declare mc_user_path
|
||||
mc_user_path=$(getent passwd "$USER" | cut -d: -f6)
|
||||
mc_user_path="$mc_user_path/.jriver"
|
||||
declare mc_user_path="$HOME/.jriver"
|
||||
|
||||
for dir in "$mc_system_path" "$mc_user_path"; do
|
||||
if [[ $(stat -f -c %T "$dir") == "btrfs" ]] &&
|
||||
@@ -1394,6 +1393,25 @@ disableCoW() {
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Migrate major versions
|
||||
#######################################
|
||||
migrateLibrary() {
|
||||
debug "Running: ${FUNCNAME[0]}"
|
||||
|
||||
declare mc_user_path="$HOME/.jriver"
|
||||
|
||||
declare current_config_path="$mc_user_path/Media Center $MVERSION"
|
||||
declare previous_config_path="$mc_user_path/Media Center $(( MVERSION - 1 ))"
|
||||
|
||||
if [[ ! -d "$current_config_path" ]] &&
|
||||
[[ -d "$previous_config_path" ]]; then
|
||||
echo "Migrating $previous_config_path to $current_config_path"
|
||||
rsync -a "$previous_config_path" "$current_config_path" &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Completely uninstalls MC, services, and firewall rules
|
||||
#######################################
|
||||
@@ -1549,6 +1567,7 @@ main() {
|
||||
if installMCFromRepo; then
|
||||
echo "JRiver Media Center installed successfully from repo"
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter"
|
||||
else
|
||||
@@ -1577,6 +1596,7 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user