firmware/general/package/zerotier-one/files/S90zerotier

31 lines
481 B
Bash
Executable File

#!/bin/sh
config_file=/etc/webui/zerotier.conf
if [ -e "$config_file" ]; then
. $config_file
fi
case "$1" in
start)
if [ "$zerotier_enabled" = "true" ]; then
echo "Starting zerotier-one daemon..."
modprobe tun
zerotier-one -d
else
echo "Zerotier-One service is disabled in ${config_file}."
exit 1
fi
;;
stop)
echo "Stopping zerotier-one daemon..."
killall -q zerotier-one
rmmod -w tun
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac