mirror of
https://github.com/cimryan/teslausb.git
synced 2026-03-01 04:30:33 +00:00
Get the IP address of the archive server by parsing ping output instead of using getent
This seems to work for more network configurations.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user