summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/root/etc/init.d/luci_statistics
blob: 2dc176c83c8609d1c2959855ca6c1546088dcb23 (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 /etc/rc.common

START=79
USE_PROCD=1

service_triggers()
{
	procd_add_reload_trigger "luci_statistics"
}

start_service() {
	### replace shipped config with symlink
	mkdir -p /var/etc
	if [ ! -L /etc/collectd.conf ]; then
		test -f /etc/collectd.conf && mv /etc/collectd.conf /etc/collectd.conf.bak
		ln -s /var/etc/collectd.conf /etc/collectd.conf
	fi

	### create config
	/usr/bin/stat-genconfig > /var/etc/collectd.conf

	### workaround broken permissions on /tmp
	chmod 1777 /tmp
}

reload_service() {
	restart "$@"
}

restart() {
	### regenerate config / prepare environment
	start

	### restart collectd
	/etc/init.d/collectd restart
}