Migrate library on major version upgrades
This commit is contained in:
25
installJRMC
25
installJRMC
@@ -1379,10 +1379,9 @@ getOS() {
|
|||||||
disableCoW() {
|
disableCoW() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
|
declare dir
|
||||||
declare mc_system_path="/usr/lib/jriver"
|
declare mc_system_path="/usr/lib/jriver"
|
||||||
declare mc_user_path
|
declare mc_user_path="$HOME/.jriver"
|
||||||
mc_user_path=$(getent passwd "$USER" | cut -d: -f6)
|
|
||||||
mc_user_path="$mc_user_path/.jriver"
|
|
||||||
|
|
||||||
for dir in "$mc_system_path" "$mc_user_path"; do
|
for dir in "$mc_system_path" "$mc_user_path"; do
|
||||||
if [[ $(stat -f -c %T "$dir") == "btrfs" ]] &&
|
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
|
# Completely uninstalls MC, services, and firewall rules
|
||||||
#######################################
|
#######################################
|
||||||
@@ -1549,6 +1566,7 @@ main() {
|
|||||||
if installMCFromRepo; then
|
if installMCFromRepo; then
|
||||||
echo "JRiver Media Center installed successfully from repo"
|
echo "JRiver Media Center installed successfully from repo"
|
||||||
symlinkCerts
|
symlinkCerts
|
||||||
|
migrateLibrary
|
||||||
restoreLicense
|
restoreLicense
|
||||||
openFirewall "jriver-mediacenter"
|
openFirewall "jriver-mediacenter"
|
||||||
else
|
else
|
||||||
@@ -1577,6 +1595,7 @@ main() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
symlinkCerts
|
symlinkCerts
|
||||||
|
migrateLibrary
|
||||||
restoreLicense
|
restoreLicense
|
||||||
openFirewall "jriver-mediacenter"
|
openFirewall "jriver-mediacenter"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user