From 0061ac549a7203e9ed08b1a48661edc1847d39f7 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:45:05 +0200 Subject: [PATCH] Test server validity --- .templates/00-smb_mounts.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.templates/00-smb_mounts.sh b/.templates/00-smb_mounts.sh index c0b022d72..c27dcc0eb 100755 --- a/.templates/00-smb_mounts.sh +++ b/.templates/00-smb_mounts.sh @@ -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"