#!/bin/sh
#
# $MidnightBSD$

# PROVIDE: redis
# REQUIRE: LOGIN
# BEFORE:  securelevel
# KEYWORD: shutdown

# Add the following line to /etc/rc.conf to enable `redis':
#
#redis_enable="YES"
#

. /etc/rc.subr

name="redis"
rcvar="${name}_enable"

extra_commands="reload"

command="/usr/local/bin/redis-server"
pidfile="/var/run/redis/$name.pid"

# read configuration and set defaults
load_rc_config "$name"
: ${redis_enable="NO"}
: ${redis_user="redis"}
: ${redis_config="/usr/local/etc/$name.conf"}

command_args="${redis_config}"
required_files="${redis_config}"
run_rc_command "$1"
