Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
FlockLab 1 - deprecated
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
TEC
P
Public
FlockLab
FlockLab 1 - deprecated
Commits
335988fd
Commit
335988fd
authored
Oct 23, 2019
by
Reto Da Forno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
script updated
parent
ba80497e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
tools/scripts/embed_image.sh
tools/scripts/embed_image.sh
+19
-3
No files found.
tools/scripts/embed_image.sh
View file @
335988fd
...
...
@@ -3,6 +3,22 @@
# embeds an exe/elf file into a the Flocklab XML config file
XMLFILE
=
flocklab.xml
SEDCMD
=
sed
B64CMD
=
base64
which
$SEDCMD
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"command '
$SEDCMD
' not found"
exit
1
fi
which
$B64CMD
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"command '
$B64CMD
' not found"
exit
1
fi
if
[
$#
-lt
1
]
;
then
...
...
@@ -29,9 +45,9 @@ fi
B64FILE
=
"
$1
.b64"
base64
$1
>
$B64FILE
sed
-i
-n
'1h;1!H;${ g;s/<data>.*<\/data>/<data>\n<\/data>/;p}'
$XMLFILE
sed
-i
"/<data>/r
${
B64FILE
}
"
$XMLFILE
$B64CMD
$1
>
$B64FILE
$SEDCMD
-i
-n
'1h;1!H;${ g;s/<data>.*<\/data>/<data>\n<\/data>/;p}'
$XMLFILE
$SEDCMD
-i
"/<data>/r
${
B64FILE
}
"
$XMLFILE
rm
$B64FILE
echo
"image
$1
embedded into
$XMLFILE
"
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