parent
013c7763dc
commit
b29c6c1920
@ -0,0 +1,7 @@
|
|||||||
|
# Calculate path=/etc/conf.d name=#-cut(1,.)-# format=openrc
|
||||||
|
# /etc/conf.d/homeassistant: configuration for /etc/init.d/homeassistant
|
||||||
|
|
||||||
|
# Switches to pass to hass. See 'hass --help' for
|
||||||
|
# a description of the possible switches.
|
||||||
|
#
|
||||||
|
HASS_OPTS=""
|
@ -1,26 +1,4 @@
|
|||||||
# Calculate format=samba path=/var/calculate chmod=600 grep(/var/calculate/ini.env,homeassistant_sites_domain)== protected
|
# Calculate format=samba path=/var/calculate grep(/var/calculate/ini.env,homeassistant_sites_domain)== protected
|
||||||
[homeassistant]
|
[homeassistant]
|
||||||
protocol = http
|
protocol = http
|
||||||
domain = home.example.org
|
domain = #-ip()-#
|
||||||
|
|
||||||
# for a self-signed certificate
|
|
||||||
[req]
|
|
||||||
default_bits = 2048
|
|
||||||
prompt = no
|
|
||||||
default_md = sha256
|
|
||||||
req_extensions = req_ext
|
|
||||||
distinguished_name = some_dn
|
|
||||||
|
|
||||||
[some_dn]
|
|
||||||
C = RU
|
|
||||||
L = Saint-Petersburg
|
|
||||||
O = Calculate Linux
|
|
||||||
emailAddress = support@calculate.ru
|
|
||||||
CN = calculate-linux.org
|
|
||||||
|
|
||||||
[req_ext]
|
|
||||||
subjectAltName = @alt_names
|
|
||||||
|
|
||||||
[alt_names]
|
|
||||||
DNS.1 = otherdomain.com
|
|
||||||
IP.1 = 1.2.3.4
|
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
# Calculate chown=homeassistant:homeassistant
|
@ -0,0 +1,3 @@
|
|||||||
|
# Calculate path=/etc name=group format=patch protected
|
||||||
|
<reg>dialout:x:20:homeassistant</reg>
|
||||||
|
<text>dialout:x:20:homeassistant,zigbee2mqtt</text>
|
@ -1,4 +1,9 @@
|
|||||||
# Calculate format=samba path=/var/calculate chmod=600 grep(/var/calculate/ini.env,zigbee2mqtt)== protected
|
# Calculate format=samba path=/var/calculate chmod=600 grep(/var/calculate/ini.env,zigbee2mqtt)== protected
|
||||||
[zigbee2mqtt]
|
[zigbee2mqtt]
|
||||||
|
#?exists(/dev/ttyUSB0)-#
|
||||||
|
dev = /dev/ttyUSB0
|
||||||
|
#exists#
|
||||||
|
#?exists(/dev/ttyACM0)-#
|
||||||
dev = /dev/ttyACM0
|
dev = /dev/ttyACM0
|
||||||
|
#exists#
|
||||||
nodeenv = 16.15.0
|
nodeenv = 16.15.0
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
# Calculate path=/etc/init.d name=#-cut(1,.)-# chmod=755 comment=# exists(/var/calculate/www/zigbee2mqtt/zigbee2mqtt-live)!=
|
||||||
|
#!/sbin/openrc-run
|
||||||
|
# Copyright 2023 Gentoo Authors
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
description="Allows you to use your Zigbee devices without the vendor's bridge or gateway"
|
||||||
|
|
||||||
|
user="zigbee2mqtt"
|
||||||
|
group="zigbee2mqtt"
|
||||||
|
|
||||||
|
command="/var/calculate/www/zigbee2mqtt/zigbee2mqtt-live/.venv/bin/npm"
|
||||||
|
directory="/var/calculate/www/${RC_SVCNAME}/${RC_SVCNAME}-live"
|
||||||
|
command_args="start"
|
||||||
|
command_user="${user}:${group}"
|
||||||
|
command_background="yes"
|
||||||
|
pidfile="/run/${RC_SVCNAME}.pid"
|
||||||
|
output_log="/var/log/${RC_SVCNAME}.log"
|
||||||
|
error_log="${output_log}"
|
||||||
|
export PATH="/var/calculate/www/zigbee2mqtt/zigbee2mqtt-live/.venv/bin:$PATH"
|
||||||
|
|
||||||
|
depend() {
|
||||||
|
need mosquitto
|
||||||
|
}
|
||||||
|
|
||||||
|
stop(){
|
||||||
|
ebegin "Stopping ${SVCNAME}"
|
||||||
|
start-stop-daemon --stop --quiet --retry 20 --pidfile $pidfile
|
||||||
|
eend $?
|
||||||
|
}
|
||||||
|
|
||||||
|
start_pre() {
|
||||||
|
checkpath --file --owner $user --mode 0644 $output_log
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
# Calculate path=/etc/runlevels/default name=#-cut(1,.)-# link=/etc/init.d/#-cut(1,.)-# protected symbolic exists(/var/calculate/www/zigbee2mqtt/zigbee2mqtt-live)!=
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Define the IP address
|
||||||
|
|
||||||
|
interface=$(ip route | grep -m 1 'default via' | awk '{print $5}')
|
||||||
|
if [[ -z $interface ]]
|
||||||
|
then
|
||||||
|
interface=eth0
|
||||||
|
fi
|
||||||
|
IP=$(ifconfig $interface 2>/dev/null | grep 'inet ' | awk '{print $2}')
|
||||||
|
echo $IP
|
Loading…
Reference in new issue