mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-22 16:51:51 +02:00
Clean birdnet-pi
This commit is contained in:
24
zzz_draft_birdnet-pi/rootfs/etc/cont-init.d/31-ingress.sh
Normal file
24
zzz_draft_birdnet-pi/rootfs/etc/cont-init.d/31-ingress.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
#################
|
||||
# NGINX SETTING #
|
||||
#################
|
||||
|
||||
declare ingress_interface
|
||||
declare ingress_port
|
||||
|
||||
bashio::log.info "Setting up ingress"
|
||||
|
||||
echo "... adding new instructions"
|
||||
cat /Caddyfile >> /etc/caddy/Caddyfile
|
||||
rm /Caddyfile
|
||||
|
||||
echo "... customizing"
|
||||
ingress_port=$(bashio::addon.ingress_port)
|
||||
ingress_interface=$(bashio::addon.ip_address)
|
||||
ingress_entry=$(bashio::addon.ingress_entry)
|
||||
sed -i "s/%%port%%/${ingress_port}/g" /etc/caddy/Caddyfile
|
||||
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/caddy/Caddyfile
|
||||
sed -i "s|%%ingress_entry%%|${ingress_entry}|g" /etc/caddy/Caddyfile
|
||||
@@ -7,18 +7,29 @@ set -e
|
||||
#################
|
||||
|
||||
# Starting dbus
|
||||
echo "Starting service: dbus"
|
||||
bashio::log.info "Starting system services..."
|
||||
echo "... dbus"
|
||||
service dbus start
|
||||
|
||||
bashio::log.info "ALSA_CARD option is set to $(bashio::config "ALSA_CARD"). If the microphone doesn't work, please adapt it"
|
||||
echo " "
|
||||
# Starting php service
|
||||
echo "... php"
|
||||
until [[ -e /var/run/dbus/system_bus_socket ]]; do
|
||||
sleep 1s
|
||||
done
|
||||
systemctl start php*service
|
||||
|
||||
########################
|
||||
# CONFIGURE birdnet-pi #
|
||||
########################
|
||||
|
||||
bashio::log.info "Starting app..."
|
||||
# Starting avahi service
|
||||
echo "... avahi"
|
||||
systemctl start avahi*service
|
||||
|
||||
# Restarting all services
|
||||
bashio::log.info "Ensuring birdnet.conf is in /config ; please customize as needed"
|
||||
if [ ! -f /config/birdnet.conf ]; then
|
||||
cp /etc/birdnet/birdnet.conf /config
|
||||
fi
|
||||
|
||||
bashio::log.info "Starting BirdNET-Pi services"
|
||||
chmod +x $HOME/BirdNET-Pi/scripts/restart_services
|
||||
/.$HOME/BirdNET-Pi/scripts/restart_services &>/proc/1/fd/1
|
||||
|
||||
bashio::log.info "App is accessible from webui"
|
||||
Reference in New Issue
Block a user