1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00
nextcloud_ynh/conf/owncloud_post_migration.sh
Maniack Crudelis 8ea155ee6d Complete refactoring
* Refactoring
* Fix upgrade script
* Fix owncloud migration + new helper ynh_handle_app_migration
* Add more informations about ynh_handle_app_migration
* Fix typos, enhance comments, fix spacing
* Rename $dependencies to $pkg_dependencies as matter of homogeneity with other apps
* [enh] Change the label during the migration
2017-09-26 07:18:12 +02:00

45 lines
1.2 KiB
Bash

#!/bin/bash
# Ending the migration process from Owncloud to Nextcloud
set -u
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source /usr/share/yunohost/helpers
#=================================================
# SET VARIABLES
#=================================================
old_app="__OLD_APP__"
new_app="__NEW_APP__"
script_name="$0"
#=================================================
# MOVE HOOKS
#=================================================
hooks_dir="/etc/yunohost/hooks.d/"
mv "$hooks_dir/post_user_create/50-$old_app" "$hooks_dir/post_user_create/50-$new_app"
#=================================================
# DELETE OLD APP'S SETTINGS
#=================================================
ynh_secure_remove "/etc/yunohost/apps/$old_app"
yunohost app ssowatconf
#=================================================
# REMOVE THE OLD USER
#=================================================
ynh_system_user_delete $old_app
#=================================================
# DELETE THIS SCRIPT
#=================================================
echo "rm $script_name" | at now + 1 minutes