summarylogtreecommitdiffstats
path: root/camillagui.install
blob: 82c59025edbf7cdf0d4672733eab456310685aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
post_install() {
	dspdir=/srv/http/data/camilladsp
	guidir=/srv/http/settings/camillagui
	
	cp -f $dspdir/configs/{camilladsp,default_config}.yml
	ln -s $dspdir/configs/{camilladsp,active_config}.yml
	
    sed -i 's/"build")$/"build", follow_symlinks=True)/' $guidir/backend/routes.py
	
	sed -i -e '/cdsp.get_volume/ a\
    elif name == "mute":\
        config = cdsp.get_config()\
        mute = True if cdsp.get_mute() else False\
        volume = cdsp.get_volume()\
        result = {"config": config, "mute": mute, "volume": volume}\
        return web.json_response(result)\
        
' -e '/cdsp.set_volume/ a\
    elif name == "mute":\
        cdsp.set_mute(value == "true")
' $guidir/backend/views.py
	
	sed -E -i -e 's|~/|/srv/http/data/|g
' -e 's|(port: )5000|\15005|
' -e 's|(symlink: )false|\1true|
' -e 's|(on_set_active_config: ).*|\1"/srv/http/bash/settings/features.sh camilladspasound"|
' $guidir/config/camillagui.yml
	
	sed -i 's/\(apply_config_automatically: \).*/\1true/' $guidir/config/gui-config.yml
	
	chown -R http:http $dspdir $guidir
	chmod -R 755 $guidir
}