Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

homebridge: Add removal script. #197

Merged
merged 2 commits into from
Oct 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ below for usage and instructions.
- [Duck DNS](/docs/duckdns.md)
- [Hassbian](/docs/hassbian.md)
- [Home Assistant](/docs/homeassistant.md)
- [Homebridge](/docs/homebridge.md)
- [HUE](/docs/hue.md)
- [LibCEC](/docs/libcec.md)
- [MariaDB](/docs/mariadb.md)
Expand Down
15 changes: 15 additions & 0 deletions docs/homebridge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description

**Installation of this script has been deprecated in favor of the
[`homekit` component](homekit_component)**

This script only removes a previously installed installation of homebridge.

## Remove
ludeeus marked this conversation as resolved.
Show resolved Hide resolved

```bash
sudo hassbian-config remove homebridge
```

<!--- Links --->
[homekit_component]:https://www.home-assistant.io/components/homekit/
38 changes: 38 additions & 0 deletions package/opt/hassbian/suites/homebridge.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
function homebridge-show-short-info {
echo "Removes Homebridge from this system."
}

function homebridge-show-long-info {
echo "Removes Homebridge from this system."
}

function homebridge-show-copyright-info {
echo "Original concept by Ludeeus <https://github.com/ludeeus>."
}

function homebridge-install-package {
echo "The installation of homebrige has been deprecated in favor of the 'homekit' component."
echo "To remove homebridge from this system run 'sudo hassbian-config remove homebridge.'"
}

function homebridge-remove-package {
echo "Starting removal of Homebridge."

echo "Removing service."
systemctl stop homebridge.service
systemctl disable homebridge.service
rm /etc/systemd/system/homebridge.service
systemctl daemon-reload

echo "Removing the homebridge user."
deluser --remove-home homebridge

echo "Removing homebridge."
npm remove -g homebridge-homeassistant
npm remove -g --unsafe-perm homebridge hap-nodejs node-gyp

return 0
}

[[ "$_" == "$0" ]] && echo "hassbian-config helper script; do not run directly, use hassbian-config instead"