#!/sbin/openrc-run name=edge description="N2N Edge Daemon" instance=${RC_SVCNAME##*.} [ -n "$instance" ] && : ${cfgfile:=/etc/n2n/edge-$instance.conf} : ${cfgfile:=/etc/n2n/edge.conf} command="/usr/sbin/edge" command_args="$cfgfile ${command_opts}" command_args_foreground="-f" supervisor="supervise-daemon" pidfile="/run/$name.pid" output_log="/var/log/${RC_SVCNAME}.log" error_log="/var/log/${RC_SVCNAME}.log" retry="${EDGE_RETRY:-TERM/60/KILL/10}" depend() { need net after firewall } start_pre() { checkpath -f -m 0644 -o "$command_user" "$output_log" "$error_log" checkpath -f -m 0640 -o "$command_user" "$cfgfile" }