summaryrefslogtreecommitdiff
path: root/ext/installfiles/mac/launch.sh
blob: ed5170291817369c300b61a6965932cc23a973c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

zthome="/Library/Application Support/ZeroTier/One"
ztapp="/Applications/ZeroTier One.app"

export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$zthome"

# Uninstall if the .app has been thrown away
if [ ! -d "$ztapp" ]; then
	if [ -e "$zthome/uninstall.sh" ]; then
		cd "$zthome"
		./uninstall.sh -q
		exit
	fi
fi

# Create the app deletion notification symlink if it does
# not already exist.
if [ ! -L "$zthome/shutdownIfUnreadable" ]; then
	rm -f "$zthome/shutdownIfUnreadable"
	ln -sf "$ztapp/Contents/Info.plist" "$zthome/shutdownIfUnreadable"
fi

# Launch ZeroTier One (not as daemon... launchd monitors it)
exec zerotier-one