mirror of
https://github.com/YunoHost-Apps/agendav_ynh.git
synced 2024-09-03 20:36:12 +02:00
remove || true and finish users helpers
This commit is contained in:
parent
cd8ffbee1c
commit
d27688b513
3 changed files with 8 additions and 15 deletions
|
@ -12,8 +12,8 @@ dbname=$app
|
|||
dbuser=$app
|
||||
|
||||
# Drop MySQL database and user
|
||||
ynh_mysql_drop_db "$dbname" || true
|
||||
ynh_mysql_drop_user "$dbuser" || true
|
||||
ynh_mysql_drop_db "$dbname"
|
||||
ynh_mysql_drop_user "$dbuser"
|
||||
|
||||
# Retrieve domain from app settings
|
||||
domain=$(ynh_app_setting_get "$app" domain)
|
||||
|
@ -27,11 +27,8 @@ rm -f "/etc/php5/fpm/pool.d/${app}.conf"
|
|||
ynh_remove_app_dependencies
|
||||
|
||||
# Reload services
|
||||
service php5-fpm restart || true
|
||||
service nginx reload || true
|
||||
service php5-fpm restart
|
||||
service nginx reload
|
||||
|
||||
# Remove the user account
|
||||
# (must be done after php-fpm restart)
|
||||
id "$app" >/dev/null 2>&1 \
|
||||
&& deluser --quiet --remove-home "$app" >/dev/null \
|
||||
|| true
|
||||
ynh_system_user_delete "$app"
|
||||
|
|
|
@ -52,11 +52,7 @@ else
|
|||
ynh_die "You must install Baïkal or Radicale before"
|
||||
fi
|
||||
|
||||
if ! id -u $app > /dev/null 2>&1 ; then
|
||||
useradd -c "$app system account" \
|
||||
-d /var/www/$app --system --user-group $app --shell /usr/sbin/nologin \
|
||||
|| ynh_die "Unable to create $app system account"
|
||||
fi
|
||||
ynh_system_user_create "$app" "$final_path"
|
||||
|
||||
# Restore the app files and set permissions
|
||||
cp -a ./sources "$DESTDIR"
|
||||
|
|
|
@ -128,5 +128,5 @@ then
|
|||
fi
|
||||
|
||||
# Reload services
|
||||
service php5-fpm restart || true
|
||||
service nginx reload || true
|
||||
service php5-fpm restart
|
||||
service nginx reload
|
||||
|
|
Loading…
Add table
Reference in a new issue