18 lines
		
	
	
		
			633 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			633 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/bash
 | 
						|
# enable nginx site
 | 
						|
ln -sf /etc/nginx/sites-available/OpenMediaCenter.conf /etc/nginx/sites-enabled/OpenMediaCenter.conf
 | 
						|
 | 
						|
# setup database
 | 
						|
mysql -uroot -pPASS -e "CREATE DATABASE IF NOT EXISTS mediacenter;"
 | 
						|
mysql -uroot -pPASS -e "CREATE USER IF NOT EXISTS 'mediacenteruser'@'localhost' IDENTIFIED BY 'mediapassword';"
 | 
						|
mysql -uroot -pPASS -e "GRANT ALL PRIVILEGES ON mediacenter . * TO 'mediacenteruser'@'localhost';"
 | 
						|
 | 
						|
# correct user rights
 | 
						|
chown -R www-data:www-data /var/www/openmediacenter
 | 
						|
 | 
						|
# restart services
 | 
						|
systemctl restart nginx
 | 
						|
 | 
						|
systemctl enable OpenMediaCenter.service
 | 
						|
systemctl restart OpenMediaCenter.service
 |