conditionalize the install/uninstall scripts to support linux or darwin.

This commit is contained in:
Jon Maddox
2015-09-14 23:20:13 -04:00
parent 6540c25baf
commit 25981deac4
2 changed files with 29 additions and 6 deletions

View File

@@ -1,6 +1,17 @@
#!/bin/sh
echo "Uninstalling Homebridge..."
# make forever stop the app.
forever stop homebridge > /dev/null 2>&1
launchctl unload ~/Library/LaunchAgents/org.homebridge.plist
rm ~/Library/LaunchAgents/org.homebridge.plist
if [[ "$OSTYPE" == "linux*" ]]; then
## install for linux
echo ""
elif [[ "$OSTYPE" == "darwin"* ]]; then
## uninstall for OS X
# tell launchd to stop the process.
launchctl unload ~/Library/LaunchAgents/org.homebridge.plist
# remove the launchd script.
rm ~/Library/LaunchAgents/org.homebridge.plist
fi