I wrote a CLI provisioning config generator for the ISP Supplies SIM
data files some time ago.  I keep updating it as the data file changes
format or the new Telrad software changes syntax.

I just fixed it for 6.6.  If it's of use to anyone else, great!  If not,
oh well.

It's very simple.  No magic.  But I would hate to be manually adding
these things.

I don't know if all the vendors supply the simcard data in the same
format or not.  You may have to tweak the script for your use.

============================
#!/usr/bin/env sh
# CSV format:
#"CUSTOMER NAME",IMSI,ICCID,Key,OPc

#
# Using statically assigned IPs.  Haven't used a full private /24,
# yet.  The math is as simple as it gets, just increment the last octet.
# Store the last used IP in a file.  If multiple users run this, the
# LASTIP_FILE needs to be fully specified rather than just looking in
# ${HOME}.
#
# This pre-provisions all cards at the 20x3 plan.  We manually set the
# speed via BreezeView at install time.
# 
# From the root login on the BreezeVIew server:
#    su lteadmin
#    ncs_cli -u admin
# 
# Then copy and past the config lines which this script outputs.


FIRST3OCT="10.X.X" # First three octets of the IP range.
GSPN="20x3";  # Global Service Profile Name
LASTIP_FILE=${HOME}/telradlast.txt

ARGCOUNT=$#;
#echo "ARGS = $#";

if [ ${ARGCOUNT} -lt 1 ]; then
  echo "ARGS must be higher than 0";
  echo "Need a source csv file"
  exit 1;
else
  CSVFILE=$1;
fi;

LASTIP=`head -1 ${LASTIP_FILE}`;

echo "";
echo "configure";

cat ${CSVFILE} | (IFS=,; while read CNAME IMSI ICCID KEY OPC ; do

if [ $IMSI != "IMSI" ]; then
   LASTIP=$(expr ${LASTIP} + 1);

# this echo should be all one line:
   echo "set lte-network HSS subscribers-list ${IMSI} authentication-key ${KEY} 
op-or-opc-value ${OPC} pdn-address-allocation ${FIRST3OCT}.${LASTIP} 
global-service-profile-name ${GSPN} op-vs-opc OPCValueUsed allowed-epcs all 
imsi-activation Active subscriber-information first-name UnProvisioned 
last-name SIMCard"
fi;

echo ${LASTIP} > ${LASTIP_FILE};

done; )
echo "";
echo "# Don't forget to \"commit\"."
echo "";
============================


-- 
Scott Lambert                    KC5MLE                       Unix SysAdmin
lamb...@lambertfam.org
_______________________________________________
Telrad mailing list
Telrad@wispa.org
http://lists.wispa.org/mailman/listinfo/telrad

Reply via email to