DTux
/
dtux__moha
Archived
1
0
Fork 0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__moha/tools/install.sh

31 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/bash
rsync -aP --exclude "*~" --exclude *kate-swp $1/config/ /etc/moha/
chmod a+rX -R /etc/moha
chown domotique:domotique -R /etc/moha
rsync -aP --exclude "*~" --exclude *kate-swp $1/webserver/ /var/www/html/moha/
chmod u+rX -R /var/www/html/moha/
chown apache:apache -R /var/www/html/moha
rsync -aP --exclude "*~" --exclude *kate-swp $1/daemons/ /usr/bin/
rsync -aP --exclude "*~" --exclude *kate-swp $1/systemd/ /etc/systemd/system/
mkdir /usr/share/moha
chown domotique:domotique -R /usr/share/moha
touch /var/log/moha.log
chown domotique:domotique -R /var/log/moha.log
#CREATE USER 'moha'@'localhost' IDENTIFIED BY 'MohaMysql';
#mysql -p < ./sql/moha.sql
# GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
systemctl daemon-reload
R=`systemctl is-enabled presenceD.service`
if [ $R != "enabled" ];then
echo "enabling presenceD.service"
systemctl enable presenceD.service
fi
R=`systemctl is-enabled moha.service`
if [ $R != "enabled" ];then
echo "enabling moha.service"
systemctl enable moha.service
fi
#must enable service