#!/bin/sh
#
# $NetBSD: snapclient.sh,v 1.2 2022/07/06 10:02:14 nia Exp $
#
# PROVIDE: snapclient
# KEYWORD: shutdown
#

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="snapclient"
rcvar=${name}
command="/usr/pkg/bin/snapclient"
command_args="-d"
pidfile="/var/run/snapclient/pid"
snapclient_user="snapclient"
snapclient_group="snapclient"
start_precmd="snapclient_precmd"

snapclient_precmd()
{
	if [ ! -d "/var/run/snapclient" ]; then
		mkdir -p -m 755 "/var/run/snapclient"
		chown snapclient:snapclient "/var/run/snapclient"
	fi
}

load_rc_config $name
run_rc_command "$1"
