friendica - Adapt to new sequencer options

This commit is contained in:
2022-06-14 11:08:50 +02:00
parent 43e0b61d1a
commit 26532b3fd3

View File

@@ -1,19 +1,14 @@
#!/bin/bash #!/bin/bash
toolName=friendica readonly toolName=friendica
latestUrl="https://api.github.com/repos/friendica/friendica/releases/latest" readonly latestUrl="https://api.github.com/repos/friendica/friendica/releases/latest"
# Get script working directory sq_config=0
# (when called from a different directory)
WDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >>/dev/null 2>&1 && pwd )"
CONFIG=0
CONFIG_FILE_NAME="${toolName}.cfg"
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
seq_config() { seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE" initSeqConfig "${seq_configName}" "${seq_configTemplate}"
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
CONFIG=1 sq_config=1
fi fi
} }
@@ -21,7 +16,7 @@ step_20_info() {
shift shift
echoinfoArgs "[FRIENDICA ROOT]" echoinfoArgs "[FRIENDICA ROOT]"
echo -n "Create a backup" echo -n "Create a backup"
if [ $CONFIG -ne 0 ] ; then if [ $sq_config -ne 0 ] ; then
echo " at $FR_BACKUP" echo " at $FR_BACKUP"
else else
echo echo
@@ -31,7 +26,7 @@ step_20_alias() { echo "backup"; }
step_20() { step_20() {
shift shift
local tempRoot= local tempRoot=
if [ $CONFIG -eq 0 ] ; then if [ $sq_config -eq 0 ] ; then
error -e "No configuration file found" error -e "No configuration file found"
return 1 return 1
fi fi
@@ -44,7 +39,7 @@ step_20() {
tempRoot="$FR_LOC" tempRoot="$FR_LOC"
fi fi
exe $WDIR/mysql.sh -qq backup "$FR_DATABASE" "$FR_BACKUP" exe "${seq_dir}/mysql.sh" -qq backup "$FR_DATABASE" "$FR_BACKUP"
endReturn -o $? "Backup mysql database failed" endReturn -o $? "Backup mysql database failed"
[ ! -e "$tempRoot" ] && endReturn -o 1 -f "Friendica root $tempRoot not found" [ ! -e "$tempRoot" ] && endReturn -o 1 -f "Friendica root $tempRoot not found"
@@ -142,7 +137,7 @@ step_22() {
endReturn -o $? "Backup failed; $FR_LOC renamed!" endReturn -o $? "Backup failed; $FR_LOC renamed!"
echo " [I] Installing version $latestVersion to $FR_LOC" echo " [I] Installing version $latestVersion to $FR_LOC"
exe mv "$tempExtract" "$FR_LOC" exe mv "$tempExtract" "$FR_LOC"
exe mv "$tempExtractAddons" "$tempAddons" exe mv "$tempExtractAddons/addon" "$tempAddons"
exe chown -R www-data: "$FR_LOC" exe chown -R www-data: "$FR_LOC"
# Configuration # Configuration