1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wallabag2_ynh.git synced 2024-10-01 13:35:06 +02:00

Cleanup hooks

This commit is contained in:
Salamandar 2024-03-15 12:43:40 +01:00
parent 1ff3cc79fc
commit 93888166b4
2 changed files with 13 additions and 7 deletions

View file

@ -2,6 +2,8 @@
app="__APP__" app="__APP__"
user="__APP__" user="__APP__"
install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
# Retrieve arguments # Retrieve arguments
username=$1 username=$1
@ -14,6 +16,7 @@ source /usr/share/yunohost/helpers
user_pass=$(ynh_string_random) user_pass=$(ynh_string_random)
# Create the new user in Wallabag # Create the new user in Wallabag
(cd "/var/www/$app" && \ pushd "$install_dir" || ynh_die
sudo -u "$user" php "bin/console" --no-interaction --env=prod \ sudo -u "$user" "php$phpversion" "bin/console" --no-interaction --env=prod \
fos:user:create "$username" "$user_email" "$user_pass") fos:user:create "$username" "$user_email" "$user_pass"
popd || ynh_die

View file

@ -2,12 +2,15 @@
app="__APP__" app="__APP__"
user="__APP__" user="__APP__"
install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir)
phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion)
# Retrieve arguments # Retrieve arguments
username=$1 username=$1
purge=$2 purge=$2
# Deactivate the user from Wallabg # Deactivate the user from Wallabag
(cd "/var/www/$app" && \ pushd "$install_dir" || ynh_die
sudo -u "$user" php "bin/console" --no-interaction --env=prod \ sudo -u "$user" "php$phpversion" "bin/console" --no-interaction --env=prod \
fos:user:deactivate "$username") fos:user:deactivate "$username"
popd || ynh_die