summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/installfiles/mac/install.tmpl.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/installfiles/mac/install.tmpl.sh b/ext/installfiles/mac/install.tmpl.sh
index 75773250..fcb3b69b 100644
--- a/ext/installfiles/mac/install.tmpl.sh
+++ b/ext/installfiles/mac/install.tmpl.sh
@@ -55,6 +55,15 @@ echo 'Installing zerotier-cli command line utility...'
ln -sf "/Library/Application Support/ZeroTier/One/zerotier-one" /usr/bin/zerotier-cli
+if [ ! -f '/Library/Application Support/ZeroTier/One/authtoken.secret' ]; then
+ echo 'Pre-creating authtoken.secret for ZeroTier service...'
+ if [ $dryRun -eq 0 ]; then
+ rm -f '/Library/Application Support/ZeroTier/One/authtoken.secret'
+ head -c 1024 /dev/urandom | md5 | head -c 24 >'/Library/Application Support/ZeroTier/One/authtoken.secret'
+ chmod 0600 '/Library/Application Support/ZeroTier/One/authtoken.secret'
+ fi
+fi
+
echo 'Installing and (re-)starting zerotier-one service via launchctl...'
if [ ! -z "`launchctl list | grep -F com.zerotier.one`" ]; then