projects
/
feed
/
packages.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
488ac04
)
zerotier: abort on zerotier-idtool error
author
Moritz Warning
<moritzwarning@web.de>
Thu, 12 Apr 2018 15:48:14 +0000
(17:48 +0200)
committer
Moritz Warning
<moritzwarning@web.de>
Thu, 12 Apr 2018 21:20:37 +0000
(23:20 +0200)
Signed-off-by: Moritz Warning <moritzwarning@web.de>
net/zerotier/files/zerotier.init
patch
|
blob
|
history
diff --git
a/net/zerotier/files/zerotier.init
b/net/zerotier/files/zerotier.init
index 78fe87e9476066ad615a1dd96abe32ee486af92e..6d0f4f239dec776c40fc579b919ea2ee70f6e7f7 100644
(file)
--- a/
net/zerotier/files/zerotier.init
+++ b/
net/zerotier/files/zerotier.init
@@
-44,10
+44,13
@@
start_instance() {
if [ "$secret" = "generate" ]; then
echo "Generate secret - please wait..."
- local tmp="/tmp/zt.$cfg.secret"
- zerotier-idtool generate "$tmp" > /dev/null
- secret="$(cat $tmp)"
- rm "$tmp"
+ local sf="/tmp/zt.$cfg.secret"
+
+ zerotier-idtool generate "$sf" > /dev/null
+ [ $? -ne 0 ] && return 1
+
+ secret="$(cat $sf)"
+ rm "$sf"
uci set zerotier.$cfg.secret="$secret"
uci commit zerotier