Test server validity

This commit is contained in:
Alexandre
2023-04-10 18:45:05 +02:00
committed by GitHub
parent c67c4a2f2d
commit 0061ac549a

View File

@@ -58,6 +58,13 @@ if bashio::config.has_value 'networkdisks'; then
exit 0
fi
# Does server exists
server="$(echo "$disk" | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")"
if [ -f /usr/bin/ping ]; then
ping "$server" >/dev/null || \
bashio::log.fatal "Your server $server from $disk doesn't ping, is it correct?"
fi
# Prepare mount point
mkdir -p /mnt/"$diskname"
chown -R root:root /mnt/"$diskname"