mirror of
https://github.com/YunoHost-Apps/agendav_ynh.git
synced 2024-09-03 20:36:12 +02:00
fix baikal/radicale support
This commit is contained in:
parent
e3238b7d7b
commit
fef269c129
2 changed files with 36 additions and 11 deletions
|
@ -13,20 +13,15 @@ fi
|
||||||
|
|
||||||
baikal=0
|
baikal=0
|
||||||
radicale=0
|
radicale=0
|
||||||
|
if [[ $(sudo yunohost app list --json | grep -q '"id": "baikal"') -eq 0 ]]; then
|
||||||
sudo yunohost app list --json | grep -q '"id": "baikal"'
|
echo "Detected Baikal"
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
baikal=1
|
baikal=1
|
||||||
caldavapp=baikal
|
caldavapp=baikal
|
||||||
fi
|
elif [[ $(sudo yunohost app list --json | grep -q '"id": "radicale"')? -eq 0 ]]; then
|
||||||
|
echo "Detected Radicale"
|
||||||
sudo yunohost app list --json | grep -q '"id": "radicale"'
|
|
||||||
if [[ $? -eq 0 ]]; then
|
|
||||||
radicale=1
|
radicale=1
|
||||||
caldavapp=radicale
|
caldavapp=radicale
|
||||||
fi
|
else
|
||||||
|
|
||||||
if [ $baikal -eq 0 ] && [ $radicale -eq 0 ]; then
|
|
||||||
echo "Error : You must install Baikal or Radicale before"
|
echo "Error : You must install Baikal or Radicale before"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -57,6 +52,7 @@ cd $final_path/web/application && ln -s ../config config && cd $currentpath
|
||||||
# caldav config
|
# caldav config
|
||||||
caldavdomain=$(sudo yunohost app setting $caldavapp domain)
|
caldavdomain=$(sudo yunohost app setting $caldavapp domain)
|
||||||
caldavpath=$(sudo yunohost app setting $caldavapp path)
|
caldavpath=$(sudo yunohost app setting $caldavapp path)
|
||||||
|
caldavpath=${caldavpath%/}
|
||||||
if [ $baikal -eq 1 ]; then
|
if [ $baikal -eq 1 ]; then
|
||||||
caldav_principal_url="https://$caldavdomain$caldavpath/cal.php/%u/"
|
caldav_principal_url="https://$caldavdomain$caldavpath/cal.php/%u/"
|
||||||
caldav_calendar_url="https://$caldavdomain$caldavpath/cal.php/calendars/%s/"
|
caldav_calendar_url="https://$caldavdomain$caldavpath/cal.php/calendars/%s/"
|
||||||
|
@ -64,6 +60,7 @@ elif [ $radicale -eq 1 ]; then
|
||||||
caldav_principal_url="https://$caldavdomain$caldavpath/%u/"
|
caldav_principal_url="https://$caldavdomain$caldavpath/%u/"
|
||||||
caldav_calendar_url="https://$caldavdomain$caldavpath/%s/"
|
caldav_calendar_url="https://$caldavdomain$caldavpath/%s/"
|
||||||
fi
|
fi
|
||||||
|
echo "----- $caldav_principal_url"
|
||||||
sed -i "s@YNH_CALDAV_PRINCIPAL_URL@$caldav_principal_url@g" ../conf/caldav.php
|
sed -i "s@YNH_CALDAV_PRINCIPAL_URL@$caldav_principal_url@g" ../conf/caldav.php
|
||||||
sed -i "s@YNH_CALDAV_CALENDAR_URL@$caldav_calendar_url@g" ../conf/caldav.php
|
sed -i "s@YNH_CALDAV_CALENDAR_URL@$caldav_calendar_url@g" ../conf/caldav.php
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
baikal=0
|
||||||
|
radicale=0
|
||||||
|
if [[ $(sudo yunohost app list --json | grep -q '"id": "baikal"') -eq 0 ]]; then
|
||||||
|
echo "Detected Baikal"
|
||||||
|
baikal=1
|
||||||
|
caldavapp=baikal
|
||||||
|
elif [[ $(sudo yunohost app list --json | grep -q '"id": "radicale"')? -eq 0 ]]; then
|
||||||
|
echo "Detected Radicale"
|
||||||
|
radicale=1
|
||||||
|
caldavapp=radicale
|
||||||
|
else
|
||||||
|
echo "Error : You must install Baikal or Radicale before"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
domain=$(sudo yunohost app setting agendav domain)
|
domain=$(sudo yunohost app setting agendav domain)
|
||||||
path=$(sudo yunohost app setting agendav path)
|
path=$(sudo yunohost app setting agendav path)
|
||||||
path=${path%/}
|
path=${path%/}
|
||||||
|
@ -23,7 +38,20 @@ currentpath=$(pwd)
|
||||||
cd $final_path/web/application && ln -s ../config config && cd $currentpath
|
cd $final_path/web/application && ln -s ../config config && cd $currentpath
|
||||||
|
|
||||||
# caldav config
|
# caldav config
|
||||||
radicale_path=$(sudo yunohost app setting radicale path)
|
caldavdomain=$(sudo yunohost app setting $caldavapp domain)
|
||||||
|
caldavpath=$(sudo yunohost app setting $caldavapp path)
|
||||||
|
caldavpath=${caldavpath%/}
|
||||||
|
if [ $baikal -eq 1 ]; then
|
||||||
|
caldav_principal_url="https://$caldavdomain$caldavpath/cal.php/%u/"
|
||||||
|
caldav_calendar_url="https://$caldavdomain$caldavpath/cal.php/calendars/%s/"
|
||||||
|
elif [ $radicale -eq 1 ]; then
|
||||||
|
caldav_principal_url="https://$caldavdomain$caldavpath/%u/"
|
||||||
|
caldav_calendar_url="https://$caldavdomain$caldavpath/%s/"
|
||||||
|
fi
|
||||||
|
echo "----- $caldav_principal_url"
|
||||||
|
sed -i "s@YNH_CALDAV_PRINCIPAL_URL@$caldav_principal_url@g" ../conf/caldav.php
|
||||||
|
sed -i "s@YNH_CALDAV_CALENDAR_URL@$caldav_calendar_url@g" ../conf/caldav.php
|
||||||
|
|
||||||
radicale_path=${radicale_path%/}
|
radicale_path=${radicale_path%/}
|
||||||
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/caldav.php
|
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/caldav.php
|
||||||
sed -i "s@YNH_RADICALE_PATH@$radicale_path@g" ../conf/caldav.php
|
sed -i "s@YNH_RADICALE_PATH@$radicale_path@g" ../conf/caldav.php
|
||||||
|
|
Loading…
Add table
Reference in a new issue