From 9c24ca5a56e62c8b418a8394e02e0a34ec589fd1 Mon Sep 17 00:00:00 2001 From: Marc Mance Date: Wed, 5 Jun 2024 16:34:02 -0400 Subject: [PATCH] added perform.sh --- perform.sh | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 perform.sh diff --git a/perform.sh b/perform.sh new file mode 100755 index 0000000..efaac83 --- /dev/null +++ b/perform.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +local_time=$(date +%Y-%m-%d\ %H:%M:%S) +timestamp=$(date +%s) + +hostname=`hostname` +role=$1 + +testFileName="testFile-1G" + +function createTestFile(){ + dd if=/dev/urandom of=/var/tmp/$testFileName count=1 bs=1G status=progress +} + +if [[ $1 == "server" || $1 == "client" ]]; then + echo "setting role to $role" + + # debian + # Get IP address of a specific interface (replace eth0 with your interface name) + # ip_address=$(ip addr show ntb0 | grep 'inet addr' | awk '{print $2}' | cut -d '/' -f 1) + + # freebsd + # Get IP address using ifconfig + # ip_address=$(ifconfig ntb0 | grep 'inet.*' -m 1 | awk '{print $2}' | cut -d ':' -f 2 | cut -d ' ' -f 1) + +else + echo "must run with client/server argument" + exit +fi + + +if [[ $role == "server" ]]; then + echo "Please enter IP address to host Server:" + read ip_address + echo "Server will start on: $ip_address" +fi + + +if [[ $role == "client" ]]; then + echo "What is the IP address of Server:" + read ip_address + echo "" + echo "Attempting to ping server...." + ping -c 2 $ip_address + echo "" + echo "If the pings failed, you may cancel now, or press enter to continue" + read continue + echo "" + echo "Creating /var/tmp/$testFileName" + createTestFile + echo "" + echo "Listing TestFile" + ls -lah /var/tmp/$testFileName + echo "" + echo "Listing SMB Shares on Server" + smbclient -L $ip_address +fi + + + + + +#read testSMB + +# smb testing +# get share name + +# nfs testing +# dd/pv testing