-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #374 from yggdrasil-network/develop
Version 0.3.4
- Loading branch information
Showing
30 changed files
with
1,030 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Last Modified: Sat Mar 9 06:08:02 2019 | ||
#include <tunables/global> | ||
|
||
/usr/bin/yggdrasil { | ||
#include <abstractions/base> | ||
|
||
capability net_admin, | ||
|
||
network inet stream, | ||
network inet dgram, | ||
network inet6 dgram, | ||
network inet6 stream, | ||
network netlink raw, | ||
|
||
/lib/@{multiarch}/ld-*.so mr, | ||
/proc/sys/net/core/somaxconn r, | ||
/dev/net/tun rw, | ||
|
||
/usr/bin/yggdrasil mr, | ||
/etc/yggdrasil.conf rw, | ||
/run/yggdrasil.sock rw, | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/sh | ||
|
||
CONFFILE="/etc/yggdrasil.conf" | ||
|
||
genconf() { | ||
/usr/bin/yggdrasil -genconf > "$1" | ||
return $? | ||
} | ||
|
||
probetun() { | ||
modprobe tun | ||
return $? | ||
} | ||
|
||
start() { | ||
if [ ! -f "$CONFFILE" ]; then | ||
printf 'Generating configuration file: ' | ||
if genconf "$CONFFILE"; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
return 1 | ||
fi | ||
fi | ||
|
||
if [ ! -e /dev/net/tun ]; then | ||
printf 'Inserting TUN module: ' | ||
if probetun; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
return 1 | ||
fi | ||
fi | ||
|
||
printf 'Starting yggdrasil: ' | ||
if start-stop-daemon -S -q -b -x /usr/bin/yggdrasil \ | ||
-- -useconffile "$CONFFILE"; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
fi | ||
} | ||
|
||
stop() { | ||
printf "Stopping yggdrasil: " | ||
if start-stop-daemon -K -q -x /usr/bin/yggdrasil; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
fi | ||
} | ||
|
||
reload() { | ||
printf "Reloading yggdrasil: " | ||
if start-stop-daemon -K -q -s HUP -x /usr/bin/yggdrasil; then | ||
echo "OK" | ||
else | ||
echo "FAIL" | ||
start | ||
fi | ||
} | ||
|
||
restart() { | ||
stop | ||
start | ||
} | ||
|
||
case "$1" in | ||
start|stop|restart|reload) | ||
"$1";; | ||
*) | ||
echo "Usage: $0 {start|stop|restart|reload}" | ||
exit 1 | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.