#!/bin/sh /etc/rc.common

USE_PROCD=1
START=99
STOP=01

start_service() {
  echo "Starting nordvpnlite service"
  procd_open_instance
  procd_set_param command /usr/sbin/nordvpnlite start --no-detach
  procd_set_param stdout 1
  procd_set_param stderr 1
  # By default procd will try to respawn the process every 5 seconds.
  # if in the first 3600 seconds, the process dies 5 times, procd gives up
  procd_set_param respawn
  procd_close_instance
}

stop_service() {
  echo "Stopping nordvpnlite service"
  /usr/sbin/nordvpnlite stop
}

reload_service() {
  stop
  sleep 1
  start
}
