From 6cfb7e2be7828e4233e353df175fb373b8e56007 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Sat, 21 Mar 2020 01:31:24 +0100 Subject: [PATCH] Fix hooks --- hooks/post_user_create | 4 ++-- hooks/post_user_delete | 4 ++-- scripts/install | 7 +++++++ scripts/upgrade | 7 +++++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/hooks/post_user_create b/hooks/post_user_create index 1509e89..40b0216 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -1,7 +1,7 @@ #!/bin/bash -app="wallabag2" -user="wallabag2" +app="__APP__" +user="__APP__" # Retrieve arguments username=$1 diff --git a/hooks/post_user_delete b/hooks/post_user_delete index acda6ad..6a39516 100644 --- a/hooks/post_user_delete +++ b/hooks/post_user_delete @@ -1,7 +1,7 @@ #!/bin/bash -app="wallabag2" -user="wallabag2" +app="__APP__" +user="__APP__" # Retrieve arguments username=$1 diff --git a/scripts/install b/scripts/install index 0a58263..1005880 100644 --- a/scripts/install +++ b/scripts/install @@ -167,6 +167,13 @@ chmod 600 $wb_conf chown -R $app: $final_path chmod 755 $final_path +#================================================= +# SETUP HOOKS +#================================================= + +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_create" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_delete" + #================================================= # SETUP SSOWAT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 13fcb68..812e649 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -187,6 +187,13 @@ chmod 600 $wb_conf chown -R $app: $final_path chmod 755 $final_path +#================================================= +# SETUP HOOKS +#================================================= + +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_create" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../hooks/post_user_delete" + #================================================= # SETUP SSOWAT #=================================================