File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ ExecStart=/opt/homebridge/start.sh
13
13
Restart =always
14
14
RestartSec =3
15
15
KillMode =process
16
+ AmbientCapabilities =CAP_NET_BIND_SERVICE
16
17
17
18
[Install]
18
19
Alias =homebridge
Original file line number Diff line number Diff line change 73
73
# post-install only
74
74
if [ " $1 " = " configure" ] && [ -z $2 ]; then
75
75
IP=$( hostname -I)
76
+ PORT=8581
77
+
78
+ # check to see if an alternate port is defined in the config
79
+ if [ -f /var/lib/homebridge/config.json ]; then
80
+ PORT_FROM_CONFIG=$( cat /var/lib/homebridge/config.json | jq ' .platforms[] | select(.platform | contains("config")) | .port' 2> /dev/null)
81
+ if [ ${# PORT_FROM_CONFIG} -gt 0 ]; then
82
+ PORT=$PORT_FROM_CONFIG
83
+ fi
84
+ fi
76
85
77
86
echo " "
78
87
echo " Homebridge Installation Complete!"
@@ -81,9 +90,9 @@ if [ "$1" = "configure" ] && [ -z $2 ]; then
81
90
82
91
for ip in $IP ; do
83
92
if [[ $ip =~ ^[0-9]+\. [0-9]+\. [0-9]+\. [0-9]+$ ]]; then
84
- echo " * http://$ip :8581 "
93
+ echo " * http://$ip :$PORT "
85
94
else
86
- echo " * http://[$ip ]:8581 "
95
+ echo " * http://[$ip ]:$PORT "
87
96
fi
88
97
done
89
98
You can’t perform that action at this time.
0 commit comments