packages/net/yggdrasil/files/yggdrasil.init
George Iv e135c4c867 yggdrasil: bump to 0.4.0
- Bump yggdrasil-go version to v0.4.0
- Update ygguci tool for compatibility with the new yggdrasil-go version
- Yggdrasil's config file is now generated in a separate command before running the daemon

Signed-off-by: George Iv <zhoreeq@users.noreply.github.com>
2021-07-19 15:46:16 +03:00

38 lines
634 B
Bash
Executable file

#!/bin/sh /etc/rc.common
START=90
STOP=85
USE_PROCD=1
BIN_FILE="/usr/sbin/yggdrasil"
CONFIG_FILE="/tmp/yggdrasil.conf"
DAEMON_OPTS="-useconffile $CONFIG_FILE"
start_service()
{
[ -f /etc/uci-defaults/yggdrasil ] && ( . /etc/uci-defaults/yggdrasil )
/usr/sbin/ygguci get | $BIN_FILE -useconf -normaliseconf -json > $CONFIG_FILE
procd_open_instance
procd_set_param respawn
procd_set_param command $BIN_FILE $DAEMON_OPTS
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop_service()
{
killall yggdrasil
}
reload_service()
{
restart
}
service_triggers()
{
procd_add_reload_trigger yggdrasil
}