#!/bin/sh /etc/rc.common
# Copyright(c) 2011-2015 Shenzhen TP-LINK Technologies Co.Ltd.
# file     ipsec init
# brief    this file will be called by INIT process.
# author   Gao Jie
# version  1.0.0
# date     23Sep22
# histry   arg 1.0.0, 23Sep22, Gao Jie, Create the file. 

START=98

start() { 
    DETECT_DIR="/tmp/failover_detect"
    BACKUP_LIST="/tmp/failover_backup_list"
    [ ! -d "${DETECT_DIR}" ] && mkdir "${DETECT_DIR}"
    [ ! -f "${BACKUP_LIST}" ] && touch "${BACKUP_LIST}"
	lua /usr/lib/lua/ipsec/ipsec_failover_process_manager.lua add
}

stop() {
    lua /usr/lib/lua/ipsec/ipsec_failover_process_manager.lua del
}

restart() {
    stop
    start
}