On Fri, May 18, 2012 at 6:35 PM, Douglas Hubler <[email protected]> wrote:
> On Fri, May 18, 2012 at 11:16 AM, Dan Chang <[email protected]> wrote:
>> Unfortunately, my e-mail system Mimi-defanged me or something like that T_T
>> Could you change the extension of the script to like ".txt" and try
>> posting again? I think that will do it...maybe.
>
>
> I suspect george's script looked like this, adjust as nec.
>
> #!/usr/bin/ruby
>
> puts "User name,Voice-mail PIN,SIP password,First name,Last name,User
> alias,EMail address,User group,Phone serial number,Phone model,Phone
> group,Phone description"
> (10021..10030).each {|i|
> puts "#{i},1234,J3llyD0nut,Fname#{i},Lname#{i},,,import"
> }
Yes, kind of, attached as .txt, let me know it it works
George
#!/bin/bash
START=$(date +%s)
usage="5000users -s start -n number_of_users"
declare -i start
declare -i n
declare -i end
#declare -i i
while getopts 's:n:' o
do case "$o" in
s) start=$OPTARG;;
n) n=$OPTARG;;
[?]) echo >&2 $usage
exit 1;;
esac
done
end=$(($start+$n))
echo User name,Voice-mail PIN,SIP password,First name,Last name,User
alias,EMail address,User group,Phone serial number,Phone model,Phone
group,Phone description,Im Id,Job Title,Job department,Company name,Assistant
name,Cell phone number,Home phone number,Assistant phone number,Fax
number,Alternate email,Alternate im,Location,Home street,Home city,Home
state,Home country,Home zip,Office street,Office city,Office state,Office
country,Office zip > 5000user.csv
#prepend 0s
#for ((i in {$start..$end}
for (( i=$start; i<$end; i++ ))
do
len=`expr length $i`
uid=$i
for (( j=$len; j<5; j++))
do
uid=0$uid
done
echo
\"2$uid\",\"07b51638e092eb24166589b33de84b12\",\"123\",\"Fname$i\",\"Lname$i\",\"\",\"[email protected]\",\"\",\"\",\"\",\"\",\"\",\"im$i\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\"
>> 5000user.csv
done
END=$(date +%s)
DIFF=$(( $END - $START ))
mins=$(($DIFF/60))
out="Script took $DIFF seconds"
echo $out;
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/