refactoring changes from sequpgrade (endReturn, ...) and some modernizations

This commit is contained in:
2023-01-03 15:49:08 +01:00
parent 215135e8aa
commit 3c22d5729f
69 changed files with 553 additions and 654 deletions

View File

@@ -40,16 +40,16 @@ step_20() {
fi
exe "${seq_dir}/mysql.sh" -qq backup "$FR_DATABASE" "$FR_BACKUP"
endReturn -o $? "Backup mysql database failed"
endReturn "Backup mysql database failed"
[ ! -e "$tempRoot" ] && endReturn -o 1 -f "Friendica root $tempRoot not found"
local wwwBackup="$FR_BACKUP/${toolName}_www_`date +%Y%m%d-%H%M%S`.tar.gz"
local dataBackup="$FR_BACKUP/${toolName}_data_`date +%Y%m%d-%H%M%S`.tar.gz"
echo " [I] Backing up webserver directory to $wwwBackup"
info "Backing up webserver directory to $wwwBackup"
exe cd "$tempRoot/.."
exe tar czf "$wwwBackup" $(basename "$tempRoot")
echo " [I] Backing up data directory to $dataBackup"
info "Backing up data directory to $dataBackup"
exe cd "$FR_LOC_DATA/.."
exe tar czf "$dataBackup" $(basename "$FR_LOC_DATA")
}
@@ -110,21 +110,21 @@ step_22() {
if [ ! -e "$tempExtract" ] ; then
exe mkdir -p "$tempDown"
exe wget -O "$tempLoc" $downUrl
endReturn -o $? "Download failed: $downUrl"
endReturn "Download failed: $downUrl"
exe cd "$tempDown"
exe tar -xf "$tempLoc"
endReturn -o $? "Extract failed: $tempLoc"
endReturn "Extract failed: $tempLoc"
else
info "Found existing download: $tempExtract"
fi
if [ ! -e "$tempExtractAddons" ] ; then
exe wget -O "$tempLocAddons" $downUrlAddons
endReturn -o $? "Download failed: $downUrlAddons"
endReturn "Download failed: $downUrlAddons"
exe cd "$tempDown"
exe mkdir -p "$tempExtractAddons"
exe tar -xC "${tempExtractAddons}" -f "$tempLocAddons"
endReturn -o $? "Extract failed: $tempLocAddons"
endReturn "Extract failed: $tempLocAddons"
else
info "Found existing download: $tempExtractAddons"
fi
@@ -135,7 +135,7 @@ step_22() {
exe mv "$FR_LOC" "$tempBu"
step backup "$tempBu"
endReturn -o $? "Backup failed; $FR_LOC renamed!"
endReturn "Backup failed; $FR_LOC renamed!"
info "Installing version $latestVersion to $FR_LOC"
exe systemctl stop friendica.service
exe mv "$tempExtract" "$FR_LOC"