2020-09-26 16:19:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-08-25 23:51:07 +02:00
|
|
|
# Upgrade ScoDoc installation using APT
|
2024-08-24 14:39:02 +02:00
|
|
|
#
|
2020-09-26 16:19:37 +02:00
|
|
|
# This script STOP and RESTART ScoDoc and should be runned as root
|
|
|
|
#
|
|
|
|
# Upgrade also the Linux system using apt.
|
|
|
|
#
|
2024-08-24 14:39:02 +02:00
|
|
|
# Script for ScoDoc 9. Lancé automatiquement par scodoc-updater.
|
2020-09-26 16:19:37 +02:00
|
|
|
#
|
2021-08-25 23:51:07 +02:00
|
|
|
# E. Viennet, sep 2013, mar 2017, jun 2019, aug 2020, dec 2020, aug 21
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2024-08-24 14:39:02 +02:00
|
|
|
set -euo pipefail
|
2021-07-25 09:51:09 +02:00
|
|
|
|
2021-08-02 10:34:28 +02:00
|
|
|
# Le répertoire de ce script:
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
|
|
|
|
|
|
source "$SCRIPT_DIR/config.sh"
|
|
|
|
source "$SCRIPT_DIR/utils.sh"
|
|
|
|
|
|
|
|
cd "$SCODOC_DIR" || { echo "Invalid directory"; exit 1; }
|
|
|
|
|
2023-01-05 13:56:20 +01:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2020-12-19 19:22:22 +01:00
|
|
|
check_uid_root "$0"
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
if [ -z "$SCODOC_UPGRADE_RUNNING" ]
|
|
|
|
then
|
|
|
|
apt-get update && apt-get -y dist-upgrade
|
2021-11-21 23:58:18 +01:00
|
|
|
# install spécifiquement scodoc9, utile si les dépendances Debian de scodoc9
|
|
|
|
# ont été changées, ce qui peut provoquer un
|
|
|
|
# "packages have been kept back"
|
2024-08-24 14:39:02 +02:00
|
|
|
apt install scodoc9 || alarm_admin "apt install scodoc9 failed"
|
2020-09-26 16:19:37 +02:00
|
|
|
fi
|
2021-08-25 23:51:07 +02:00
|
|
|
systemctl restart redis
|
|
|
|
systemctl restart nginx
|
|
|
|
systemctl restart scodoc9
|