Adding the code

This commit is contained in:
pdxkay
2020-07-21 22:11:11 -07:00
parent 363fdfa4fa
commit 7478330d0a
4 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
#!/bin/sh
PREREQ="udev"
prereqs() {
echo "$PREREQ"
}
case "$1" in
prereqs)
prereqs
exit 0
;;
esac
. /scripts/functions
ZT_APP=/usr/sbin/zerotier-one
# if ZT not on machine, exit
if [ ! -f ${ZT_APP} ]; then
exit 0
fi
# start zerotier if it exists
[ "$BOOT" != nfs ] || configure_networking
# create tun device file
mkdir /dev/net
mknod /dev/net/tun c 10 200
# set up local loopback
/sbin/ifconfig lo 127.0.0.1
# run zerotier-one
${ZT_APP} &> /var/log/zerotier.log &
echo $! >/run/zerotier-one.pid