summarylogtreecommitdiffstats
path: root/homebridge.install
diff options
context:
space:
mode:
authorAidan Harris2017-11-30 19:36:10 +0000
committerAidan Harris2017-11-30 19:36:10 +0000
commit225d2e4ec1c17df6462434c14107134ce58a3823 (patch)
tree707349b99a8223bac4456ed4a24ec446427ff421 /homebridge.install
downloadaur-225d2e4ec1c17df6462434c14107134ce58a3823.tar.gz
Initial Commit
Diffstat (limited to 'homebridge.install')
-rw-r--r--homebridge.install29
1 files changed, 29 insertions, 0 deletions
diff --git a/homebridge.install b/homebridge.install
new file mode 100644
index 000000000000..e2787d7787b1
--- /dev/null
+++ b/homebridge.install
@@ -0,0 +1,29 @@
+_NAME=homebridge
+
+post_install() {
+ mkdir -p /var/lib/${_NAME}
+ getent passwd ${_NAME} > /dev/null || useradd -d /var/lib/${_NAME} -s /bin/false -r ${_NAME} > /dev/null
+ chown -R ${_NAME}:${_NAME} /var/lib/${_NAME}
+
+ echo ""
+ echo "A sample configuration file is provided at /usr/lib/node_modules/homebridge/config-sample.json"
+ echo "Copy this to /var/lib/${_NAME}/config.json and edit accordingly"
+ echo " cp /usr/lib/node_modules/homebridge/config-sample.json /var/lib/${_NAME}/config.json"
+ echo " chown ${_NAME}:${_NAME} /var/lib/${_NAME}/config.json"
+ echo " \$EDITOR /var/lib/${_NAME}/config.json"
+ echo ""
+ echo "You can then start the service as follows:"
+ echo " systemctl start homebridge"
+ echo ""
+ echo "If you get a DNS related error on startup, make sure avahi-daemon is running (systemctl status -l avahi-daemon.service)"
+ echo ""
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ echo "Some files have not been removed because they are created by ${_NAME} itself."
+ userdel -f ${_NAME}
+}