mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 14:45:07 +03:00
1. added multipath protocol and schema suport
2. added SCTP protocol and schema support 3. added set of NAS models support (Asustor, ReadyNAS, Drobo, QNAP, WD, Synology, Terramaster) 4. moved to fc00::/7 private segment 5. added Windows, MacOS and Linux UI for peers edit and current status
This commit is contained in:
parent
cfa293d189
commit
d8a4000141
198 changed files with 8589 additions and 697 deletions
72
contrib/freebsd/mesh
Normal file
72
contrib/freebsd/mesh
Normal file
|
@ -0,0 +1,72 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Put the mesh and meshctl binaries into /usr/local/bin
|
||||
# Then copy this script into /etc/rc.d/mesh
|
||||
# Finally, run:
|
||||
# 1. chmod +x /etc/rc.d/mesh /usr/local/bin/{mesh,meshctl}
|
||||
# 2. echo "mesh_enable=yes" >> /etc/rc.d
|
||||
# 3. service mesh start
|
||||
#
|
||||
# PROVIDE: mesh
|
||||
# REQUIRE: networking
|
||||
# KEYWORD:
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="mesh"
|
||||
rcvar="mesh_enable"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
|
||||
pidfile="/var/run/mesh/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
command_args="-P ${pidfile} -r -f ${mesh_command}"
|
||||
|
||||
mesh_start()
|
||||
{
|
||||
test ! -x /usr/local/bin/mesh && (
|
||||
logger -s -t mesh "Warning: /usr/local/bin/mesh is missing or not executable"
|
||||
logger -s -t mesh "Copy the mesh binary into /usr/local/bin and then chmod +x /usr/local/bin/mesh"
|
||||
return 1
|
||||
)
|
||||
|
||||
test ! -f /etc/mesh.conf && (
|
||||
logger -s -t mesh "Generating new configuration file into /etc/mesh.conf"
|
||||
/usr/local/bin/mesh -genconf > /etc/mesh.conf
|
||||
)
|
||||
|
||||
tap_path="$(cat /etc/mesh.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
|
||||
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
|
||||
|
||||
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 || (
|
||||
logger -s -t mesh "Creating ${tap_name} adapter"
|
||||
/sbin/ifconfig ${tap_name} create || logger -s -t mesh "Failed to create ${tap_name} adapter"
|
||||
)
|
||||
|
||||
test ! -d /var/run/mesh && mkdir -p /var/run/mesh
|
||||
|
||||
logger -s -t mesh "Starting mesh"
|
||||
${command} ${command_args} /usr/local/bin/mesh -useconffile /etc/mesh.conf \
|
||||
1>/var/log/mesh.stdout.log \
|
||||
2>/var/log/mesh.stderr.log &
|
||||
}
|
||||
|
||||
mesh_stop()
|
||||
{
|
||||
logger -s -t mesh "Stopping mesh"
|
||||
test -f /var/run/mesh/${name}.pid && kill -TERM $(cat /var/run/mesh/${name}.pid)
|
||||
|
||||
tap_path="$(cat /etc/mesh.conf | grep /dev/tap | egrep -o '/dev/.*$')"
|
||||
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
|
||||
|
||||
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 && (
|
||||
logger -s -t mesh "Destroying ${tap_name} adapter"
|
||||
/sbin/ifconfig ${tap_name} destroy || logger -s -t mesh "Failed to destroy ${tap_name} adapter"
|
||||
)
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
: ${mesh_enable:=no}
|
||||
|
||||
run_rc_command "$1"
|
|
@ -1,72 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Put the yggdrasil and yggdrasilctl binaries into /usr/local/bin
|
||||
# Then copy this script into /etc/rc.d/yggdrasil
|
||||
# Finally, run:
|
||||
# 1. chmod +x /etc/rc.d/yggdrasil /usr/local/bin/{yggdrasil,yggdrasilctl}
|
||||
# 2. echo "yggdrasil_enable=yes" >> /etc/rc.d
|
||||
# 3. service yggdrasil start
|
||||
#
|
||||
# PROVIDE: yggdrasil
|
||||
# REQUIRE: networking
|
||||
# KEYWORD:
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="yggdrasil"
|
||||
rcvar="yggdrasil_enable"
|
||||
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
|
||||
pidfile="/var/run/yggdrasil/${name}.pid"
|
||||
command="/usr/sbin/daemon"
|
||||
command_args="-P ${pidfile} -r -f ${yggdrasil_command}"
|
||||
|
||||
yggdrasil_start()
|
||||
{
|
||||
test ! -x /usr/local/bin/yggdrasil && (
|
||||
logger -s -t yggdrasil "Warning: /usr/local/bin/yggdrasil is missing or not executable"
|
||||
logger -s -t yggdrasil "Copy the yggdrasil binary into /usr/local/bin and then chmod +x /usr/local/bin/yggdrasil"
|
||||
return 1
|
||||
)
|
||||
|
||||
test ! -f /etc/yggdrasil.conf && (
|
||||
logger -s -t yggdrasil "Generating new configuration file into /etc/yggdrasil.conf"
|
||||
/usr/local/bin/yggdrasil -genconf > /etc/yggdrasil.conf
|
||||
)
|
||||
|
||||
tap_path="$(cat /etc/yggdrasil.conf | egrep -o '/dev/tap[0-9]{1,2}$')"
|
||||
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
|
||||
|
||||
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 || (
|
||||
logger -s -t yggdrasil "Creating ${tap_name} adapter"
|
||||
/sbin/ifconfig ${tap_name} create || logger -s -t yggdrasil "Failed to create ${tap_name} adapter"
|
||||
)
|
||||
|
||||
test ! -d /var/run/yggdrasil && mkdir -p /var/run/yggdrasil
|
||||
|
||||
logger -s -t yggdrasil "Starting yggdrasil"
|
||||
${command} ${command_args} /usr/local/bin/yggdrasil -useconffile /etc/yggdrasil.conf \
|
||||
1>/var/log/yggdrasil.stdout.log \
|
||||
2>/var/log/yggdrasil.stderr.log &
|
||||
}
|
||||
|
||||
yggdrasil_stop()
|
||||
{
|
||||
logger -s -t yggdrasil "Stopping yggdrasil"
|
||||
test -f /var/run/yggdrasil/${name}.pid && kill -TERM $(cat /var/run/yggdrasil/${name}.pid)
|
||||
|
||||
tap_path="$(cat /etc/yggdrasil.conf | grep /dev/tap | egrep -o '/dev/.*$')"
|
||||
tap_name="$(echo -n ${tap_path} | tr -d '/dev/')"
|
||||
|
||||
/sbin/ifconfig ${tap_name} >/dev/null 2>&1 && (
|
||||
logger -s -t yggdrasil "Destroying ${tap_name} adapter"
|
||||
/sbin/ifconfig ${tap_name} destroy || logger -s -t yggdrasil "Failed to destroy ${tap_name} adapter"
|
||||
)
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
: ${yggdrasil_enable:=no}
|
||||
|
||||
run_rc_command "$1"
|
Loading…
Add table
Add a link
Reference in a new issue