scripts/setup/testdirs.zsh
Anna Schumaker 3e0f52b4e4 install-scripts.zsh: Various Updates
* Use $BIN from common.zsh
* Fixes for colorful output
* Install scripts to .local/bin on the remote machine
* Point setup.zsh at .local/bin instead of .bin
* Run setup/testdirs.zsh with the -e flag

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2023-07-19 13:50:02 -04:00

27 lines
455 B
Bash
Executable File

#!/bin/zsh -e
SERVER=$1
EXPORT=$2
MOUNTPOINT=$3
USER=$4
if [ "$#" -lt 4 ]; then
echo "Usage: $0 {server} {export} {mountpoint} {user}"
exit 1
fi
mkdir -p $MOUNTPOINT
mount -o sec=sys $SERVER:$EXPORT $MOUNTPOINT
for proto in tcp rdma; do
for vers in 3 4 41 42; do
dir=$MOUNTPOINT/$USER/nfsv$vers$proto
if [ ! -d $dir ]; then
mkdir -p -m 777 $dir
elif [ "$(ls -A $dir)" ]; then
rm -rf $dir/* || true
fi
done
done
umount -f $MOUNTPOINT