test
This commit is contained in:
27
sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/finish
Normal file
27
sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/finish
Normal 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."
|
Reference in New Issue
Block a user