summaryrefslogtreecommitdiffstats
path: root/admin/qbee-agent/files/qbee-agent.init
blob: c28265cc6fd79dca538c327e5f8e2adb47a7a19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh /etc/rc.common

START=99
STOP=11
USE_PROCD=1

ARGS="start"

start_service() {
	if [ ! -f /etc/qbee/qbee-agent.json ]; then
		echo "Device seems to not have been bootstrapped. Please run 'qbee-agent bootstrap -k <bootstrap-key>' as root to bootstrap."
		return 0
	fi

	procd_open_instance qbee-agent
	procd_set_param command /usr/bin/qbee-agent $ARGS
	procd_set_param respawn 3600 60 0
	procd_set_param stdout 1
	procd_set_param stderr 1
	procd_set_param pidfile /var/run/qbee-agent.pid
	procd_set_param term_timeout 600
	procd_close_instance
}