#!/bin/bash # Retrieve arguments domain=$1 path=$2 # Check domain/path availability # yunohost app checkurl $domain$path -a radicale #if [[ ! $? -eq 0 ]]; then # exit 1 #fi # Check depends installation for i in python-pip python-virtualenv python-ldap do dpkg -l | grep $i > /dev/null 2>&1 if [ $? = 1 ]; then sudo apt-get install $i -y fi done # Init virtualenv sudo virtualenv /usr/local/radicale sudo bash -c "source /usr/local/radicale/bin/activate && pip install radicale flup" #Configuration Radicale if [ ! -d /etc/radicale ]; then mkdir /etc/radicale fi cp ../conf/{radicale,logging) /etc/radicale/ # Set permissions to radicale directory # chown -R www-data: $final_path # ## Modify Nginx configuration file and copy it to Nginx conf directory #sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf #sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf # cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/radicale.conf # ## Reload Nginx and regenerate SSOwat conf # service nginx reload # yunohost app ssowatconf