mirror of
https://github.com/cimryan/teslausb.git
synced 2026-02-28 20:20:32 +00:00
Add logging to mountability verification.
This commit is contained in:
@@ -19,6 +19,8 @@ function check_archive_mountable () {
|
|||||||
|
|
||||||
local test_mount_location="/tmp/archivetestmount"
|
local test_mount_location="/tmp/archivetestmount"
|
||||||
|
|
||||||
|
echo "Verifying that the archive share is mountable..."
|
||||||
|
|
||||||
if [ ! -e "$test_mount_location" ]
|
if [ ! -e "$test_mount_location" ]
|
||||||
then
|
then
|
||||||
mkdir "$test_mount_location"
|
mkdir "$test_mount_location"
|
||||||
@@ -30,6 +32,8 @@ function check_archive_mountable () {
|
|||||||
/root/bin/write-archive-configs-to.sh "$tmp_credentials_file_path"
|
/root/bin/write-archive-configs-to.sh "$tmp_credentials_file_path"
|
||||||
|
|
||||||
local mount_failed=false
|
local mount_failed=false
|
||||||
|
echo "Mount command-line: "
|
||||||
|
echo "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 -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
|
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 ]
|
if [ "$mount_failed" = true ]
|
||||||
@@ -40,6 +44,8 @@ function check_archive_mountable () {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "The archive share is mountable."
|
||||||
|
|
||||||
umount "$test_mount_location"
|
umount "$test_mount_location"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user