testing to see if verify-archive works as expected

This commit is contained in:
Ray Tanaka
2018-10-30 22:53:51 -07:00
parent 7c3a5f4b94
commit 777db26f27

View File

@@ -24,9 +24,14 @@ function check_archive_mountable () {
mkdir "$test_mount_location"
fi
local tmp_credentials_file_path="/root/.teslaCamArchiveCredentials"
local cifs_version="${cifs_version:-3.0}"
local tmp_credentials_file_path="/tmp/.teslaCamArchiveCredentials"
echo "username=$shareuser" > "$credentials_file_path"
echo "password=$sharepassword" >> "$credentials_file_path"
local mount_failed=false
echo "//$archive_server_ip_address/$sharename" "$test_mount_location" -o "vers=${cifs_version},credentials=${tmp_credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777"
mount -t cifs "//$archive_server_ip_address/$sharename" "$test_mount_location" -o "vers=${cifs_version},credentials=${tmp_credentials_file_path},iocharset=utf8,file_mode=0777,dir_mode=0777" || mount_failed=true
if [ "$mount_failed" = true ]
@@ -40,8 +45,8 @@ function check_archive_mountable () {
umount "$test_mount_location"
}
echo "install dir: $INSTALL_DIR"
ARCHIVE_SERVER_IP_ADDRESS="$( $INSTALL_DIR/lookup-ip-address.sh "$archiveserver" )"
check_archive_server_reachable
ARCHIVE_SERVER_IP_ADDRESS="$( /root/bin/get-archiveserver-ip-address.sh )"
check_archive_mountable "$ARCHIVE_SERVER_IP_ADDRESS"