write transient files to tmpfs aka ram drive
This commit is contained in:
@@ -26,3 +26,22 @@ get_tf_whl () {
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_birdnet_mount() {
|
||||||
|
TMP_MOUNT=$(systemd-escape -p --suffix=mount "$RECS_DIR/StreamData")
|
||||||
|
cat << EOF > $HOME/BirdNET-Pi/templates/$TMP_MOUNT
|
||||||
|
[Unit]
|
||||||
|
Description=Birdnet tmpfs for transient files
|
||||||
|
ConditionPathExists=$RECS_DIR/StreamData
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=tmpfs
|
||||||
|
Where=$RECS_DIR/StreamData
|
||||||
|
Type=tmpfs
|
||||||
|
Options=mode=1777,nosuid,nodev
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
EOF
|
||||||
|
ln -sf $HOME/BirdNET-Pi/templates/$TMP_MOUNT /usr/lib/systemd/system
|
||||||
|
}
|
||||||
|
|||||||
@@ -413,6 +413,7 @@ install_services() {
|
|||||||
install_gotty_logs
|
install_gotty_logs
|
||||||
install_phpsysinfo
|
install_phpsysinfo
|
||||||
install_livestream_service
|
install_livestream_service
|
||||||
|
install_birdnet_mount
|
||||||
install_cleanup_cron
|
install_cleanup_cron
|
||||||
install_weekly_cron
|
install_weekly_cron
|
||||||
increase_caddy_timeout
|
increase_caddy_timeout
|
||||||
@@ -426,6 +427,7 @@ install_services() {
|
|||||||
|
|
||||||
if [ -f ${config_file} ];then
|
if [ -f ${config_file} ];then
|
||||||
source ${config_file}
|
source ${config_file}
|
||||||
|
source install_helpers.sh
|
||||||
install_services
|
install_services
|
||||||
chown_things
|
chown_things
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ my_dir=$HOME/BirdNET-Pi/scripts
|
|||||||
source /etc/birdnet/birdnet.conf &> /dev/null
|
source /etc/birdnet/birdnet.conf &> /dev/null
|
||||||
SCRIPTS=($(ls -1 ${my_dir}) ${HOME}/.gotty)
|
SCRIPTS=($(ls -1 ${my_dir}) ${HOME}/.gotty)
|
||||||
set -x
|
set -x
|
||||||
services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) custom_recording.service avahi-alias@.service)
|
TMP_MOUNT=$(systemd-escape -p --suffix=mount "$RECS_DIR/StreamData")
|
||||||
|
services=($(awk '/service/ && /systemctl/ && !/php/ {print $3}' ${my_dir}/install_services.sh | sort) custom_recording.service avahi-alias@.service $TMP_MOUNT)
|
||||||
|
|
||||||
remove_services() {
|
remove_services() {
|
||||||
for i in "${services[@]}"; do
|
for i in "${services[@]}"; do
|
||||||
|
|||||||
@@ -106,6 +106,12 @@ if grep -q 'birdnet_server.service' "$HOME/BirdNET-Pi/templates/birdnet_analysis
|
|||||||
systemctl daemon-reload && restart_services.sh
|
systemctl daemon-reload && restart_services.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
TMP_MOUNT=$(systemd-escape -p --suffix=mount "$RECS_DIR/StreamData")
|
||||||
|
if ! [ -f "$HOME/BirdNET-Pi/templates/$TMP_MOUNT" ]; then
|
||||||
|
install_birdnet_mount
|
||||||
|
chown $USER:$USER "$HOME/BirdNET-Pi/templates/$TMP_MOUNT"
|
||||||
|
fi
|
||||||
|
|
||||||
if grep -q 'php7.4-' /etc/caddy/Caddyfile &>/dev/null; then
|
if grep -q 'php7.4-' /etc/caddy/Caddyfile &>/dev/null; then
|
||||||
sed -i 's/php7.4-/php-/' /etc/caddy/Caddyfile
|
sed -i 's/php7.4-/php-/' /etc/caddy/Caddyfile
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user