mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-04 21:18:46 +02:00
convert to s6 services
This commit is contained in:
@@ -27,7 +27,7 @@ ENV DEBIAN_FRONTEND="noninteractive" \
|
|||||||
|
|
||||||
# hadolint ignore=DL3015
|
# hadolint ignore=DL3015
|
||||||
RUN \
|
RUN \
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
apt-get update -y && apt-get install gcc python3-dev git jq sudo -y && \
|
apt-get update -y && apt-get install gcc python3-dev git jq sudo -y && \
|
||||||
\
|
\
|
||||||
# Ensure permissions
|
# Ensure permissions
|
||||||
@@ -50,9 +50,11 @@ RUN \
|
|||||||
sed -i '1a for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do sed -i "s|sudo ||" "$file"; done' /newinstaller.sh && \
|
sed -i '1a for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do sed -i "s|sudo ||" "$file"; done' /newinstaller.sh && \
|
||||||
sed -i '1a for file in $(grep -srl "my_dir" $HOME/BirdNET-Pi/scripts); do sed -i "s|\$my_dir|/config|" "$file"; done' /newinstaller.sh && \
|
sed -i '1a for file in $(grep -srl "my_dir" $HOME/BirdNET-Pi/scripts); do sed -i "s|\$my_dir|/config|" "$file"; done' /newinstaller.sh && \
|
||||||
sed -i '1a for file in $(grep -srl "install_services.sh" $HOME/BirdNET-Pi/scripts); do sed -i "/install_services.sh/c ./install_services.sh" "$file"; done' /newinstaller.sh && \
|
sed -i '1a for file in $(grep -srl "install_services.sh" $HOME/BirdNET-Pi/scripts); do sed -i "/install_services.sh/c ./install_services.sh" "$file"; done' /newinstaller.sh && \
|
||||||
|
# Avoid systemctl
|
||||||
|
sed -i '/git clone/a sed -i "s|systemctl enable|#systemctl enable|g" $HOME/BirdNET-Pi/scripts/install_services.sh' /newinstaller.sh && \
|
||||||
\
|
\
|
||||||
/./newinstaller.sh && \
|
/./newinstaller.sh && \
|
||||||
|
|
||||||
\
|
\
|
||||||
# Adapt for lsio
|
# Adapt for lsio
|
||||||
if [ -d /app ]; then rm -r /app; fi && \
|
if [ -d /app ]; then rm -r /app; fi && \
|
||||||
@@ -72,7 +74,7 @@ RUN \
|
|||||||
#USER root
|
#USER root
|
||||||
#sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh"
|
#sudo -E -u birdnet -s /bin/bash -c "/newinstaller.sh"
|
||||||
# Correct script
|
# Correct script
|
||||||
#sed -i "s|== 0|== 7|g" /newinstaller.sh && \
|
#sed -i "s|== 0|== 7|g" /newinstaller.sh && \
|
||||||
#sed -i "s|sudo -n true|true|g" /newinstaller.sh && \
|
#sed -i "s|sudo -n true|true|g" /newinstaller.sh && \
|
||||||
#sed -i "s|sudo -K|true|g" /newinstaller.sh && \
|
#sed -i "s|sudo -K|true|g" /newinstaller.sh && \
|
||||||
#for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do \sed -i "s|sudo ||" "$file"; done && \
|
#for file in $(grep -srl "sudo" $HOME/BirdNET-Pi/scripts); do \sed -i "s|sudo ||" "$file"; done && \
|
||||||
|
|||||||
@@ -90,5 +90,5 @@
|
|||||||
},
|
},
|
||||||
"slug": "birdnet-pi",
|
"slug": "birdnet-pi",
|
||||||
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
|
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/birdnet-pi",
|
||||||
"version": "0.7"
|
"version": "0.8"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-custom_recording
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-envdir /run/user/1000
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/usr/local/bin/custom_recording.sh
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-avahi_alias
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/bin/bash -c "/usr/bin/avahi-publish -a -R %I $(hostname -I |cut -d' ' -f1)"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_analysis
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
$PYTHON_VIRTUAL_ENV /usr/local/bin/birdnet_analysis.py
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_log
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-envdir /run/user/1000
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh
|
||||||
|
|
||||||
|
#!/bin/sh
|
||||||
|
exec /usr/local/bin/gotty --address localhost -p 8080 --path log --title-format "BirdNET-Pi Log" birdnet_log.sh
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 6 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_recording
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-envdir /run/user/1000
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/usr/local/bin/birdnet_recording.sh
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 5 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-birdnet_stats
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
$HOME/BirdNET-Pi/birdnet/bin/streamlit run $HOME/BirdNET-Pi/scripts/plotly_streamlit.py --browser.gatherUsageStats false --server.address localhost --server.baseUrlPath "/stats"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-caddy
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/usr/local/bin/caddy run --config /etc/caddy/Caddyfile
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 120 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-chart_viewer
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
$PYTHON_VIRTUAL_ENV /usr/local/bin/daily_plot.py --daemon --sleep 2
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-getty
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/sbin/agetty --autologin ${USER} --noclear %I \$TERM
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-livestream
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-envdir /run/user/1000
|
||||||
|
/usr/local/bin/livestream.sh
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 10 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-spectrogram_viewer
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-setuidgid ${USER}
|
||||||
|
/usr/local/bin/spectrogram.sh
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
if { sleep 3 }
|
||||||
|
s6-svc -u /etc/s6-overlay/s6-rc.d/svc-web_terminal
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
with-contenv
|
||||||
|
s6-envdir /run/user/1000
|
||||||
|
/usr/local/bin/gotty --address localhost -w -p 8888 --path terminal --title-format "BirdNET-Pi Terminal" login
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
longrun
|
||||||
Reference in New Issue
Block a user