From 71f704608523ba724074a4899b50e367c02989e3 Mon Sep 17 00:00:00 2001 From: Thomas Balthazar Date: Sun, 12 Nov 2017 17:49:15 +0100 Subject: [PATCH] Upgrade to 0.2.2 What this upgrade does: - renew the certificate - add a daily cron job that will check if the certificate must be renewed The `renew_from_cube` script only renew the cert if it will [expire in less than 4 months](https://github.com/Neutrinet/renew_cert/blob/master/renew_from_cube.py#L29). --- scripts/upgrade | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5efb06a..3a39fe3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,12 +15,24 @@ fi # 0.2 -> 0.2.1 if [[ "$version" == "0.2" ]]; then - - get_out_of_testing - sudo yunohost app setting neutrinet version -v "0.2.1" version="0.2.1" - cd /opt/neutrinet/renew_cert + cd $RENEW_CERT_PATH + sudo ve/bin/python renew_from_cube.py +fi + +# 0.2.1 -> 0.2.2 +if [[ "$version" == "0.2.1" ]]; then + sudo yunohost app setting neutrinet version -v "0.2.2" + version="0.2.2" + + cd $RENEW_CERT_PATH sudo ve/bin/python renew_from_cube.py + + cat < /etc/cron.daily/neutrinet-renew-cert.sh +#!/bin/bash +cd $RENEW_CERT_PATH && ve/bin/python renew_from_cube.py +EOF + chmod 0755 /etc/cron.daily/neutrinet-renew-cert.sh fi -- GitLab