This commit is contained in:
ai-dev
2025-10-11 12:14:55 +02:00
parent 0085404253
commit e8681cdead
93 changed files with 3680 additions and 671 deletions

View File

@@ -0,0 +1,27 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Umount all drivers.
# ==============================================================================
declare interface
declare ipaddress
interface=$(bashio::network.name)
ipaddress=$(bashio::network.ipv4_address ${interface})
if [[ -f /tmp/local_mount ]]; then
readarray -t umdev </tmp/local_mount
if [ ${#umdev[@]} -gt 0 ]; then
bashio::log.info "Unmount drivers:\n$(printf "%s\n" "${umdev[@]}")"
umount "${umdev[@]}" 2>/dev/null || true
fi
fi
if [[ -f /tmp/remote_mount ]]; then
readarray -t umdev </tmp/remote_mount
if [ ${#umdev[@]} -gt 0 ]; then
bashio::log.info "Unmount Host drivers:\n$(printf "%s\n" "${umdev[@]}")"
line=$(printf "\"%s\" " "${umdev[@]}")
ssh root@${ipaddress%/*} -p 22222 -o "StrictHostKeyChecking no" "umount $line" || true
fi
fi
bashio::log.info "Bye."