To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 335988fd authored by Reto Da Forno's avatar Reto Da Forno

script updated

parent ba80497e
......@@ -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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment