Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
ors-utils
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ors-utils
Commits
9ce32477
Commit
9ce32477
authored
Jun 16, 2022
by
Joanne Hugé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SIM card script
parent
1ae3b03d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
5 deletions
+32
-5
uicc-v2.4/write-sim-card
uicc-v2.4/write-sim-card
+32
-5
No files found.
uicc-v2.4/write-sim-card
View file @
9ce32477
#!/bin/bash
#!/bin/bash
if
[
"$#"
-ne
2
]
;
then
#set -xv
echo
"Usage: ./write-sim-card ORS_NUMBER SIM_NUMBER"
;
exit
SOURCE
=
"
${
BASH_SOURCE
[0]
:-
$0
}
"
if
[
-z
"
$1
"
]
;
then
echo
"Usage: ./write-sim-card ORS_NUMBER [SIM_NUMBER_START]"
;
exit
;
fi
fi
N_ORS
=
$1
while
[
-h
"
$SOURCE
"
]
;
do
# resolve $SOURCE until the file is no longer a symlink
N_SIM
=
$2
TARGET
=
"
$(
readlink
"
$SOURCE
"
)
"
sudo
./program_uicc
--adm
12345678
--iccid
8986006110000000000
$N_SIM
--imsi
00101000000000
$N_SIM
--isdn
060000000
$N_SIM
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
--spn
"RS-ORS
$N_ORS
-00
$N_SIM
"
--authenticate
if
[[
$TARGET
==
/
*
]]
;
then
echo
"SOURCE '
$SOURCE
' is an absolute symlink to '
$TARGET
'"
SOURCE
=
"
$TARGET
"
else
DIR
=
"
$(
dirname
"
$SOURCE
"
)
"
echo
"SOURCE '
$SOURCE
' is a relative symlink to '
$TARGET
' (relative to '
$DIR
')"
SOURCE
=
"
$DIR
/
$TARGET
"
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
fi
done
export
OCP_DIR
=
"
$(
cd
-P
"
$(
dirname
"
$SOURCE
"
)
"
&&
pwd
)
"
adm
=
"12345678"
if
[
-z
"
$2
"
]
;
then
imsioffset
=
1
else
imsioffset
=
$2
fi
let
imsinum
=
$1
*
10+
$imsioffset
j
=
y
while
read
j
;
do
[[
$j
=
"q"
]]
&&
exit
i
=
$(
printf
"%03d"
$imsinum
)
echo
programming imsi:
$i
sudo
$OCP_DIR
/program_uicc
--adm
${
adm
}
--iccid
89860061100000000
$i
--imsi
001010000000
$i
--isdn
0600000
$i
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
-spn
"RS-ORS
$1
-0
$i
"
--authenticate
--noreadafter
let
imsinum
=
$imsinum
+1
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment