rtklib: move to github
[openwrt.org/packages.git] / net / memcached.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2010-2011 OpenWrt.org
3
4 START=80
5
6 start_instance () {
7 local section="$1"
8
9 config_get user "$section" user
10 config_get maxconn "$section" maxconn
11 config_get listen "$section" listen
12 config_get port "$section" port
13 config_get memory "$section" memory
14
15 service_start /usr/bin/memcached -d -u ${user:-nobody} \
16 -c ${maxconn:-1024} -l ${listen:-0.0.0.0} \
17 -p ${port:-11211} -U ${port:-11211} -m ${memory:-64}
18 }
19
20 start() {
21 config_load 'memcached'
22 config_foreach start_instance 'memcached'
23 }
24
25 stop() {
26 service_stop /usr/bin/memcached
27 }
28
comments