1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rspamdui_ynh.git synced 2024-09-03 20:16:32 +02:00
rspamdui_ynh/scripts/install
2016-01-20 15:17:25 +01:00

22 lines
500 B
Bash

#!/bin/bash
# Retrieve arguments
domain=$1
path=$2
sudo yunohost app checkurl $domain$path -a rspamdui
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Check port availability
sudo yunohost app checkport 11334
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# Configure Nginx and reload
# Removing trailing '/' in path to handle both subdir and subdomain installs.
sed -i "s@PATHTOCHANGE@${path%/}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/rspamdui.conf
sudo service nginx reload