This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhangyang-zerotierone/ext/installfiles/mac/launch.sh
2013-12-13 16:15:42 -08:00

25 lines
631 B
Bash
Executable File

#!/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
exec "$zthome/uninstall.sh"
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