#!/bin/bash

echo -e "\nTarget iqn.2012-02.br.unesp.ncc:$1\n\tOutgoingUser\n\tLun 0 Path=/dev/$2/$1,Type=fileio\n\tAlias $1" >> /etc/ietd.conf

echo iqn.2012-02.br.unesp.ncc:$1 ALL >> /etc/initiators.allow

echo iqn.2012-02.br.unesp.ncc:$1 ALL >> /etc/targets.allow

/etc/init.d/iscsitarget restart
