I need to create a lot of file systems, of different sizes, owners, groups, and mount points, on a lot of different servers on a regular basis. The file system info was provided to me in a spreadsheet with the following info:
Code:
servername mountpoint owner group size
My script works when I echo the information to the screen. It will go through all 20 or so lines to the end of the file. When it ssh's to the server to run the commands it only runs the first line of the input file and the script exits. What am I missing to make the script go through all of the text file?
Code:
#!/bin/bash
input=fs.txt
## Read in Data loop
while read -r line
do
IFS=$'\t' "server" "mount" "owner" "group" "size"<<<"$line"
echo "Host : $server" "Mount: $mount" "Owner: $owner" "Group: $group" "Size: $size";
## Login to server
ssh -xq user@${server} "mkdir -p '$mount'";
ssh -xq user@${server} "chown '$owner':'$group' '$mount'";
done < "$input"
Thanks