mirror of
https://github.com/YunoHost-Apps/z-push_ynh.git
synced 2024-09-03 18:05:58 +02:00
implement nextcloud upgrade
This commit is contained in:
parent
98549674bf
commit
1d2c80b1fd
1 changed files with 51 additions and 17 deletions
|
@ -141,42 +141,76 @@ ynh_replace_string __STATEDIR__ $statedir ../conf/config.php
|
|||
# Enable caldav carddav support
|
||||
if yunohost app list --installed -f baikal | grep -q id ; then
|
||||
echo "Detected Baikal"
|
||||
caldavdomain=$(ynh_app_setting_get baikal domain)
|
||||
caldavpath=$(ynh_app_setting_get baikal path)
|
||||
caldavpath=${caldavpath%/}
|
||||
bailkaldomain=$(ynh_app_setting_get baikal domain)
|
||||
bailkalpath=$(ynh_app_setting_get baikal path)
|
||||
bailkalpath=${bailkalpath%/}
|
||||
|
||||
# Configuration of backend
|
||||
ynh_replace_string __BACKEND__ BackendCombined ../conf/config.php
|
||||
ynh_replace_string __BACKEND__ BackendCombined ../conf/backend/config-autodiscover.php
|
||||
|
||||
# Configuration baikal
|
||||
ynh_replace_string __BAIKALDOMAIN__ $caldavdomain ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __BAIKALDOMAIN__ $caldavdomain ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __BAIKALPATH__ $caldavpath ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __BAIKALPATH__ $caldavpath ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __DOMAINTOCHANGE__ $domain ../conf/backend/config-imap.php
|
||||
ynh_replace_string __CALDAV_SERVER__ "${bailkaldomain}" ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __CALDAV_PATH__ "${bailkalpath}/cal.php/calendars/%u/" ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __CALDAV_PERSONAL__ "default" ../conf/backend/config-caldav.php
|
||||
|
||||
ynh_replace_string __CARDDAV_SERVER__ "${bailkaldomain}" ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __CARDDAV_PATH__ "${bailkalpath}/card.php/addressbooks/%u/" ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __CARDDAV_DEFAULT_PATH__ "${bailkalpath}/card.php/addressbooks/%u/default" ../conf/backend/config-carddav.php
|
||||
|
||||
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
|
||||
ynh_replace_string __FLAGTOCHANGE__ true ../conf/backend/config-imap.php
|
||||
|
||||
# Copy config
|
||||
cp ../conf/config.php $final_path/config.php
|
||||
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
|
||||
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
|
||||
cp ../conf/backend/config-caldav.php $final_path/backend/caldav/config.php
|
||||
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
|
||||
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
|
||||
cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php
|
||||
|
||||
elif yunohost app list --installed -f nextcloud | grep -q id ; then
|
||||
echo "Detected NextCloud"
|
||||
nextclouddomain=$(ynh_app_setting_get nextcloud domain)
|
||||
nextcloudpath=$(ynh_app_setting_get nextcloud path)
|
||||
nextcloudpath=${nextcloudpath%/}
|
||||
|
||||
# Configuration of backend
|
||||
ynh_replace_string __BACKEND__ BackendCombined ../conf/config.php
|
||||
ynh_replace_string __BACKEND__ BackendCombined ../conf/backend/config-autodiscover.php
|
||||
|
||||
# Configuration nextcloud
|
||||
ynh_replace_string __CALDAV_SERVER__ "${nextclouddomain}" ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __CALDAV_PATH__ "${nextcloudpath}/remote.php/dav/calendars/%u/" ../conf/backend/config-caldav.php
|
||||
ynh_replace_string __CALDAV_PERSONAL__ "personal" ../conf/backend/config-caldav.php
|
||||
|
||||
ynh_replace_string __CARDDAV_SERVER__ "${nextclouddomain}" ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __CARDDAV_PATH__ "${nextcloudpath}/remote.php/dav/addressbooks/users/%u/contacts/" ../conf/backend/config-carddav.php
|
||||
ynh_replace_string __CARDDAV_DEFAULT_PATH__ "${nextcloudpath}/remote.php/dav/addressbooks/users/%u/contacts/" ../conf/backend/config-carddav.php
|
||||
|
||||
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
|
||||
ynh_replace_string __FLAGTOCHANGE__ true ../conf/backend/config-imap.php
|
||||
|
||||
# Copy config
|
||||
cp ../conf/backend/config-caldav.php $final_path/backend/caldav/config.php
|
||||
cp ../conf/backend/config-carddav.php $final_path/backend/carddav/config.php
|
||||
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
|
||||
cp ../conf/backend/config-combined.php $final_path/backend/combined/config.php
|
||||
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
|
||||
else
|
||||
# Configuration of backend
|
||||
ynh_replace_string __BACKEND__ BackendIMAP ../conf/config.php
|
||||
ynh_replace_string __BACKEND__ BackendIMAP ../conf/backend/config-autodiscover.php
|
||||
|
||||
# Copy config
|
||||
cp ../conf/config.php $final_path/config.php
|
||||
ynh_replace_string __DOMAINTOCHANGE__ $domain ../conf/backend/config-imap.php
|
||||
# Configuration imap
|
||||
ynh_replace_string __IMAP_SERVER__ "${domain}" ../conf/backend/config-imap.php
|
||||
ynh_replace_string __FLAGTOCHANGE__ false ../conf/backend/config-imap.php
|
||||
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
|
||||
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
|
||||
|
||||
# Copy config
|
||||
cp ../conf/backend/config-imap.php $final_path/backend/imap/config.php
|
||||
fi
|
||||
|
||||
# Copy config
|
||||
cp ../conf/config.php $final_path/config.php
|
||||
cp ../conf/backend/config-autodiscover.php $final_path/autodiscover/config.php
|
||||
|
||||
# Fixstates to avoid full resync of devices after version upgrades
|
||||
$final_path/z-push-admin.php -a fixstates
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue