Migrate library on major version upgrades
This commit is contained in:
25
installJRMC
25
installJRMC
@@ -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,24 @@ 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
|
||||
rsync -av "$previous_config_path" "$current_config_path"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#######################################
|
||||
# Completely uninstalls MC, services, and firewall rules
|
||||
#######################################
|
||||
@@ -1549,6 +1566,7 @@ main() {
|
||||
if installMCFromRepo; then
|
||||
echo "JRiver Media Center installed successfully from repo"
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter"
|
||||
else
|
||||
@@ -1577,6 +1595,7 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
symlinkCerts
|
||||
migrateLibrary
|
||||
restoreLicense
|
||||
openFirewall "jriver-mediacenter"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user