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

# Copyright (C) 2008-2013 OpenWrt.org
# Copyright (C) 2008 Jo-Philipp Wich
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

START=91


start() {
    /lib/wireguard/wg-reload-domain.sh start
    lua /usr/lib/lua/wireguard/wireguard-common.lua start &

}

stop() {
    echo "wireguard stop " >/dev/console
    lua /usr/lib/lua/wireguard/wireguard-common.lua stop &
    /lib/wireguard/wg-reload-domain.sh stop
}

restart() {
    stop
    start
}
reload() {
    stop
    start
}
