friendica - stop service for upgrade and add notes
This commit is contained in:
@@ -115,7 +115,7 @@ step_22() {
|
|||||||
exe tar -xf "$tempLoc"
|
exe tar -xf "$tempLoc"
|
||||||
endReturn -o $? "Extract failed: $tempLoc"
|
endReturn -o $? "Extract failed: $tempLoc"
|
||||||
else
|
else
|
||||||
echo " [I] Found existing download: $tempExtract"
|
info "Found existing download: $tempExtract"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e "$tempExtractAddons" ] ; then
|
if [ ! -e "$tempExtractAddons" ] ; then
|
||||||
@@ -126,7 +126,7 @@ step_22() {
|
|||||||
exe tar -xC "${tempExtractAddons}" -f "$tempLocAddons"
|
exe tar -xC "${tempExtractAddons}" -f "$tempLocAddons"
|
||||||
endReturn -o $? "Extract failed: $tempLocAddons"
|
endReturn -o $? "Extract failed: $tempLocAddons"
|
||||||
else
|
else
|
||||||
echo " [I] Found existing download: $tempExtractAddons"
|
info "Found existing download: $tempExtractAddons"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
@@ -136,13 +136,14 @@ step_22() {
|
|||||||
exe mv "$FR_LOC" "$tempBu"
|
exe mv "$FR_LOC" "$tempBu"
|
||||||
step backup "$tempBu"
|
step backup "$tempBu"
|
||||||
endReturn -o $? "Backup failed; $FR_LOC renamed!"
|
endReturn -o $? "Backup failed; $FR_LOC renamed!"
|
||||||
echo " [I] Installing version $latestVersion to $FR_LOC"
|
info "Installing version $latestVersion to $FR_LOC"
|
||||||
|
exe systemctl stop friendica.service
|
||||||
exe mv "$tempExtract" "$FR_LOC"
|
exe mv "$tempExtract" "$FR_LOC"
|
||||||
exe mv "$tempExtractAddons/addon" "$tempAddons"
|
exe mv "$tempExtractAddons/addon" "$tempAddons"
|
||||||
exe chown -R www-data: "$FR_LOC"
|
exe chown -R www-data: "$FR_LOC"
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
echo " [I] Copying configuration"
|
info "Copying configuration"
|
||||||
exe cp -ar "$tempBu/config/local.config.php" "$FR_LOC/config/"
|
exe cp -ar "$tempBu/config/local.config.php" "$FR_LOC/config/"
|
||||||
if [ -f "$tempBu/config/addon.config.php" ]; then
|
if [ -f "$tempBu/config/addon.config.php" ]; then
|
||||||
exe cp -ar "$tempBu/config/addon.config.php" "$FR_LOC/config/"
|
exe cp -ar "$tempBu/config/addon.config.php" "$FR_LOC/config/"
|
||||||
@@ -152,7 +153,8 @@ step_22() {
|
|||||||
exe cp -ar "$tempBu/home".* "$FR_LOC/"
|
exe cp -ar "$tempBu/home".* "$FR_LOC/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " [I] Don't forget to \"clean\" if everything is working as expected"
|
exe systemctl stop friendica.service
|
||||||
|
info "Don't forget to \"clean\" if everything is working as expected"
|
||||||
}
|
}
|
||||||
tempDown="/tmp/friendica"
|
tempDown="/tmp/friendica"
|
||||||
tempLoc="$tempDown/fr.tar.gz"
|
tempLoc="$tempDown/fr.tar.gz"
|
||||||
@@ -164,5 +166,45 @@ step_24() {
|
|||||||
exe rm -rf "$tempDown"
|
exe rm -rf "$tempDown"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
step_40_info() { echo 'Notes'; }
|
||||||
|
step_40_alias() { echo 'notes'; }
|
||||||
|
step_40() {
|
||||||
|
color green
|
||||||
|
cat <<NOTES_END
|
||||||
|
* Disable cron setup
|
||||||
|
|
||||||
|
* Add configuration to local.config.php
|
||||||
|
|
||||||
|
'system' => [
|
||||||
|
[...]
|
||||||
|
'pidfile' => '/run/friendica/daemon.pid',
|
||||||
|
],
|
||||||
|
|
||||||
|
* Install Service file
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Friendica Worker Daemon
|
||||||
|
After=network.target mariadb.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always
|
||||||
|
User=www-data
|
||||||
|
Group=www-data
|
||||||
|
RuntimeDirectory=friendica
|
||||||
|
WorkingDirectory=${FR_LOC}
|
||||||
|
ExecStart=/usr/bin/php ./bin/daemon.php start
|
||||||
|
ExecStop=/usr/bin/php ./bin/daemon.php stop
|
||||||
|
PIDFile=friendica/daemon.pid
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
* RuntimeDirectory: creates a folder below \`/run\`
|
||||||
|
NOTES_END
|
||||||
|
}
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034 # Appears unused
|
||||||
readonly sqr_minVersion=16
|
readonly sqr_minVersion=16
|
||||||
|
# shellcheck disable=SC1091 # Don't follow this source
|
||||||
. /usr/local/bin/sequencer.sh
|
. /usr/local/bin/sequencer.sh
|
||||||
|
Reference in New Issue
Block a user