#!/bin/sh
############### Generate numbers UA's CSV file for sipx to import ######
csvfile=test-$(date +%Y%m%d).csv
E_NOARGS=65
number=1
if [ -z "$3" ]
then
echo "Usage: `basename $0` start_call_number number_count sip_password"
echo
exit $E_NOARGS
fi
if [ -f $csvfile ]
then
echo "The $csvfile is exist and delete it now!"
rm -f $csvfile
fi
echo "SEQUENTIAL" >$csvfile
for ((i=$1;i<$1+$2;i++))
do
echo "$i;$number;[authentication username=$i password=$3]" >>$csvfile
((number++))
done