mirror of
https://github.com/YunoHost-Apps/emailpoubelle_ynh.git
synced 2024-09-03 18:26:29 +02:00
31 lines
897 B
Bash
31 lines
897 B
Bash
#!/bin/bash
|
|
# Write all logs to file
|
|
#exec > >(tee /tmp/emailpoubelle.log)
|
|
#exec 2>&1
|
|
app=emailpoubelle
|
|
|
|
|
|
final_path=/var/www/emailpoubelle
|
|
|
|
cronline="0 */2 * * * www-data cd $final_path/www/; /usr/bin/php index.php > /dev/null 2>&1"
|
|
|
|
# Copy source files
|
|
sudo mkdir -p $final_path
|
|
sudo cp -R ../src/bin/ $final_path/bin
|
|
sudo cp -R ../src/lib/ $final_path/lib
|
|
sudo cp -R ../src/locale/ $final_path/locale
|
|
sudo cp -R ../src/www/ $final_path/www
|
|
sudo cp ../src/emailPoubelle.php $final_path/emailPoubelle.php
|
|
sudo chown -R www-data:www-data $final_path
|
|
|
|
#adding php-cli for cron
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -yqq php5-cli
|
|
#adding cronjob for removing expired email addresses
|
|
sudo echo "$cronline" | sudo tee -a /etc/cron.d/emailpoubelle
|
|
sudo chmod 644 /etc/cron.d/emailpoubelle
|
|
|
|
# Restart services
|
|
sudo service nginx reload
|
|
sudo service postfix reload
|
|
sudo yunohost app ssowatconf
|