aboutsummaryrefslogtreecommitdiff
path: root/lang/php7/files/php7-fastcgi.init
blob: 21f5b09e1545c1d158f1a585194b7a1831e27e90 (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
#!/bin/sh /etc/rc.common

START=50

SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1

start_instance() {
	local section="$1"
	local enabled
	local port

	config_get_bool enabled "$section" 'enabled' 0
	config_get port "$section" 'port' 1026

	[ $enabled -gt 0 ] || return 1

	PHP_FCGI_CHILDREN='' \
	service_start /usr/bin/php-fcgi -b $port
}

start() {
	config_load 'php7-fastcgi'
	config_foreach start_instance 'php7-fastcgi'
}

stop() {
	service_stop /usr/bin/php-fcgi
}