So I'm automating ocserv set up through shellscript, and I have created random usernames and passwords which I have in a separate file. So the goal is to read those files into mapfile. This is what I have:
usern=$(wc -l < /home/ubuntu/randomusern.txt)
mapfile password < '/home/ubuntu/randompassword.txt'
mapfile username < '/home/ubuntu/randomusern.txt'
for((i=1; i<$usern; i++))
do
allUser=$(echo ${username[@]})
allpass=$(echo ${password[@]}|ocpasswd -c "/etc/ocserv/ocpasswd" ${allUser})
done
But when I check ocpasswd. there is only one user by the name "{username[@]}" Any suggestion? Thanks!!