diff --git a/README.md b/README.md index 7dbcf97..eac467c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ It can also makes backups of specified directories. Your backups can be send to many other places, local or distant. Archivist is automatically launched periodicaly to update your backups and send the modifications to the other places. -**Shipped version:** 0.3 +**Shipped version:** 0.4 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 0878412..e6cb34f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -15,7 +15,7 @@ Il peut également faire des sauvegardes de répertoires spécifiques. Vos sauvegardes peuvent être envoyées à de nombreux autres endroits, locaux ou distants. Archivist est automatiquement lancé périodiquement pour mettre à jour vos sauvegardes et envoyer les modifications aux autres emplacements. -**Version embarquée:** 0.3 +**Version embarquée:** 0.4 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index a009872..419cce7 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/maniackcrudelis/archivist/archive/v0.3.tar.gz -SOURCE_SUM=dedc9e77677b8a65553873e91eeeaeae +SOURCE_URL=https://github.com/maniackcrudelis/archivist/archive/v0.4.tar.gz +SOURCE_SUM=1c6e3a62973f22662b95eb0bf4985daf SOURCE_SUM_PRG=md5sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index b32e906..843e9bc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Automatic backups.", "fr": "Sauvegardes automatiques." }, - "version": "0.3", + "version": "0.4", "url": "https://github.com/maniackcrudelis/archivist", "license": "GPL-3.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index cac8bd1..a1e767e 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -234,6 +234,49 @@ EOF chmod +x "/etc/cron.daily/node_update" } +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +ynh_check_starting () { + local line_to_match="$1" + local app_log="${2:-/var/log/$app/$app.log}" + local timeout=${3:-300} + + ynh_clean_check_starting () { + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + ynh_secure_remove "$templog" 2>&1 + } + + echo "Starting of $app" >&2 + systemctl restart $app + local templog="$(mktemp)" + # Following the starting of the app in its log + tail -f -n1 "$app_log" > "$templog" & + # Get the PID of the tail command + local pid_tail=$! + + local i=0 + for i in `seq 1 $timeout` + do + # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout + if grep --quiet "$line_to_match" "$templog" + then + echo "The service $app has correctly started." >&2 + break + fi + echo -n "." >&2 + sleep 1 + done + if [ $i -eq $timeout ] + then + echo "The service $app didn't fully started before the timeout." >&2 + fi + + echo "" + ynh_clean_check_starting +} #================================================= #============= FUTURE YUNOHOST HELPER ============