Skip to content

Instantly share code, notes, and snippets.

@caius
Created February 1, 2018 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caius/2bf42bd41e1e7570a64cd13919ccc039 to your computer and use it in GitHub Desktop.
Save caius/2bf42bd41e1e7570a64cd13919ccc039 to your computer and use it in GitHub Desktop.
Homebridge install on base-64-lts 2017Q4 Joyent SmartOS
# Notes on how I installed the zone by hand, hopefully this is enough of a pointer to get
# you up and running!
# Prior art & help found at https://git.frubar.net/bluemaex/homekitten
pkgin install -y gmake gcc49
cat > /root/package.json <<JSON
{
"name": "homebridge-installer",
"version": "0.0.1",
"main": "index.js",
"dependencies": {
"homebridge": "0.4.37",
"homebridge-dummy": "0.3.0",
}
}
JSON
npm install
svcadm enable dns/multicast
mkdir -p /root/.homebridge
cat > /root/.homebridge/config.json <<JSON
{
"bridge": {
"name": "DaBridge",
"username": "DA:DA:DA:DA:DA:DA",
"port": 51826,
"pin": "111-11-111"
},
"description": "Homebridge. Connects things to HomeKit that potentially shouldn't be.",
"accessories": [
],
"platforms": [
]
}
JSON
# To run by hand to check it's working at this point
# DEBUG=* ./node_modules/.bin/homebridge -D
cat > /tmp/homebridge.xml <<XML
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
<service name='site/homebridge' type='service' version='0'>
<create_default_instance enabled='false'/>
<single_instance/>
<dependency name='network' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/milestone/network:default'/>
</dependency>
<dependency name='filesystem' grouping='require_all' restart_on='error' type='service'>
<service_fmri value='svc:/system/filesystem/local'/>
</dependency>
<exec_method name='start' type='method' exec='/root/node_modules/.bin/homebridge &amp;' timeout_seconds='60'>
<method_context>
<method_credential user='root' group='root' privileges='basic,net_privaddr'/>
<method_environment>
<envvar name='PATH' value='/usr/local/sbin:/usr/local/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin'/>
<envvar name='HOME' value='/root'/>
<envvar name='DEBUG' value='*'/>
</method_environment>
</method_context>
</exec_method>
<exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'/>
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='contract'/>
<propval name='ignore_error' type='astring' value='core,signal'/>
</property_group>
<stability value='Evolving'/>
<template>
<common_name>
<loctext xml:lang='C'>Homebridge</loctext>
</common_name>
</template>
</service>
</service_bundle>
XML
svccfg import /tmp/homebridge.xml
svcs homebridge
svcadm enable homebridge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment