summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/root/etc/uci-defaults/luci-statistics
blob: e94a8637c853711af203cce93c1c54f83b9a0d88 (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
34
35
36
#!/bin/sh

# register commit handler
uci -q batch <<-EOF >/dev/null
	delete ucitrack.@luci_statistics[-1]
	add ucitrack luci_statistics
	set ucitrack.@luci_statistics[-1].init=luci_statistics
	commit ucitrack
EOF

# register LuCId virtual path handler
[ -f /etc/config/lucid ] && \
uci -q batch <<-EOF >/dev/null
	delete lucid.statistics

	set lucid.statistics=DirectoryPublisher
	set lucid.statistics.name='RRDTool Image Cache'
	set lucid.statistics.physical=/tmp/rrdimg
	set lucid.statistics.virtual=/rrdimg
	set lucid.statistics.domain=''

	add_list lucid.http.publisher=statistics
	add_list lucid.https.publisher=statistics

	commit lucid
EOF

# symlink for busybox httpd
[ -x /usr/sbin/httpd ] && [ ! -h /www/rrdimg ] && \
	ln -s /tmp/rrdimg /www/rrdimg

# restart LuCId service
[ -x /etc/init.d/lucid ] && /etc/init.d/lucid enabled && /etc/init.d/lucid restart

rm -f /tmp/luci-indexcache
exit 0