mirror of https://github.com/OpenIPC/firmware.git
Merge pull request #315 from themactep/zerotier
re-use config from web ui plugin. no config means no zerotier, anyway.pull/316/head
commit
ca3169ba5e
|
@ -3,22 +3,28 @@
|
||||||
# Start zerotier-one
|
# Start zerotier-one
|
||||||
#
|
#
|
||||||
|
|
||||||
|
config_file=/etc/webui/zerotier.conf
|
||||||
|
[ ! -f "$config_file" ] && echo "Config file not found." && exit 2
|
||||||
|
source $config_file
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
if grep -q daemon=1 /etc/zerotier.conf; then
|
if [ "true" = "$zerotier_enabled" ]; then
|
||||||
echo "Starting zerotier-one daemon..."
|
echo "Starting zerotier-one daemon..."
|
||||||
/sbin/modprobe tun
|
/sbin/modprobe tun
|
||||||
/usr/sbin/zerotier-one -d
|
/usr/sbin/zerotier-one -d
|
||||||
else
|
else
|
||||||
echo "Zerotier-One service disabled in zerotier.conf..."
|
echo "Zerotier-One service is disabled in ${config_file}."
|
||||||
fi
|
exit 3
|
||||||
;;
|
fi
|
||||||
stop)
|
;;
|
||||||
echo "Stopping zerotier-one daemon..."
|
stop)
|
||||||
kill -9 $(pidof zerotier-one)
|
echo "Stopping zerotier-one daemon..."
|
||||||
/sbin/rmmod -w tun
|
kill -9 $(pidof zerotier-one)
|
||||||
;;
|
/sbin/rmmod -w tun
|
||||||
*)
|
;;
|
||||||
echo "Usage: $0 {start|stop}"
|
*)
|
||||||
exit 1
|
echo "Usage: $0 {start|stop}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
daemon=0
|
|
|
@ -20,9 +20,6 @@ endef
|
||||||
define ZEROTIER_ONE_INSTALL_TARGET_CMDS
|
define ZEROTIER_ONE_INSTALL_TARGET_CMDS
|
||||||
$(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
$(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
|
||||||
|
|
||||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc
|
|
||||||
cp ../general/package/zerotier-one/files/zerotier.conf $(TARGET_DIR)/etc
|
|
||||||
|
|
||||||
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
$(INSTALL) -m 755 -d $(TARGET_DIR)/etc/init.d
|
||||||
cp ../general/package/zerotier-one/files/S90zerotier $(TARGET_DIR)/etc/init.d
|
cp ../general/package/zerotier-one/files/S90zerotier $(TARGET_DIR)/etc/init.d
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Reference in New Issue