diff --git a/windows_archive/setup-teslausb b/windows_archive/setup-teslausb index 045360c..55524c6 100644 --- a/windows_archive/setup-teslausb +++ b/windows_archive/setup-teslausb @@ -109,7 +109,7 @@ function create_usb_drive_backing_files () { function configure_archive () { echo "Configuring the archive..." mkdir /mnt/archive - local archive_server_ip_address="$(getent hosts $archiveserver | cut -d' ' -f1)" + local archive_server_ip_address="$(ping -c 1 -w 1 $archiveserver 2>/dev/null | head -n 1 | grep -o -e "(\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\})" | tr -d '()')" echo "//$archive_server_ip_address/$sharename /mnt/archive cifs vers=3,credentials=/root/.teslaCamArchiveCredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0" >> /etc/fstab echo "username=$shareuser" > /root/.teslaCamArchiveCredentials