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
Boxiang Sun
ors-utils
Commits
6c8644e8
Commit
6c8644e8
authored
Mar 07, 2024
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write-sim-card: better bash
parent
f363bd12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
14 deletions
+3
-14
uicc/write-sim-card
uicc/write-sim-card
+3
-14
No files found.
uicc/write-sim-card
View file @
6c8644e8
#!/bin/bash
#set -xv
SOURCE
=
"
${
BASH_SOURCE
[0]
:-
$0
}
"
SOURCE
=
$(
readlink
-f
"
${
BASH_SOURCE
[0]
:-
$0
}
"
)
SOURCE_DIR
=
"
$(
cd
-P
"
$(
dirname
"
$SOURCE
"
)
"
&&
pwd
)
"
if
[
-z
"
$1
"
]
;
then
echo
"Usage: ./write-sim-card ORS_NUMBER [SIM_NUMBER_START]"
;
exit
;
fi
while
[
-h
"
$SOURCE
"
]
;
do
# resolve $SOURCE until the file is no longer a symlink
TARGET
=
"
$(
readlink
"
$SOURCE
"
)
"
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"
plmn
=
"00101"
# Albania
...
...
@@ -36,6 +25,6 @@ while read j ; do
[[
$j
=
"q"
]]
&&
exit
i
=
$(
printf
"%05d"
$imsinum
)
echo
programming imsi:
$i
sudo
$
OCP
_DIR
/program_uicc
--adm
${
adm
}
--iccid
898600611000000
$i
--imsi
${
plmn
}
00000
$i
--isdn
06000
$i
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
-spn
"RS-ORS
$1
-
$i
"
--authenticate
--noreadafter
sudo
$
SOURCE
_DIR
/program_uicc
--adm
${
adm
}
--iccid
898600611000000
$i
--imsi
${
plmn
}
00000
$i
--isdn
06000
$i
--acc
0001
--key
00112233445566778899AABBCCDDEEFF
--opc
000102030405060708090A0B0C0D0E0F
-spn
"RS-ORS
$1
-
$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