From 45c6ec233a0b06d91fa1bd1ff9d64b951541d95e Mon Sep 17 00:00:00 2001 From: ljf Date: Wed, 8 Nov 2017 21:43:16 +0100 Subject: [PATCH] [enh] Add wekan services to ynh --- scripts/_future.sh | 2 ++ scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 5 ++++- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/_future.sh b/scripts/_future.sh index abdb7ed..83a5313 100644 --- a/scripts/_future.sh +++ b/scripts/_future.sh @@ -209,3 +209,5 @@ EOF chmod +x "/etc/cron.daily/node_update" } + +ynh_version_gt() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; } diff --git a/scripts/install b/scripts/install index 40370bf..a40e004 100755 --- a/scripts/install +++ b/scripts/install @@ -118,6 +118,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 # ADD SERVICE IN ADMIN PANEL #================================================= yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add wekan #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 998b396..e620557 100644 --- a/scripts/restore +++ b/scripts/restore @@ -93,6 +93,7 @@ find "$final_path" -type d -print0 | xargs -0 chmod 750 # ADD SERVICE IN ADMIN PANEL #================================================= yunohost service add mongod --log "/var/log/mongodb.log" +yunohost service add wekan #================================================= # SETUP SSOWAT diff --git a/scripts/upgrade b/scripts/upgrade index 9583409..2d4cc31 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,10 +40,13 @@ ynh_abort_if_errors # Exit if an error occurs during the execution of the script # ENSURE DOWNWARD COMPATIBILITY #================================================= -if [ "${version}" = "0.45-1" ]; then +if ynh_version_gt "0.45-2" "${version}" ; then ynh_replace_string "Environment=ROOT_URL=http://127.0.0.1:$port$path_url" "Environment=ROOT_URL=https://$domain$path_url/" "/etc/systemd/system/$app.service" systemctl daemon-reload fi +if ynh_version_gt "0.45-3" "${version}" ; then + yunohost service add wekan +fi #================================================= # STANDARD UPGRADE STEPS