Skip to content

Commit

Permalink
20150902
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Dainese committed Sep 2, 2015
1 parent 1cf08a4 commit 9b0d14c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0-72
0.9.0-74
1 change: 1 addition & 0 deletions scripts/build_deb_unetlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ mkdir -p ${DATA_DIR}/opt/unetlab ${DATA_DIR}/opt/unetlab/addons ${DATA_DIR}/opt/
rsync -a --delete html ${DATA_DIR}/opt/unetlab/
cat html/includes/init.php | sed "s/define('VERSION', .*/define('VERSION', '${VERSION}-${RELEASE}');/g" > ${DATA_DIR}/opt/unetlab/html/includes/init.php
cp -a scripts/set_uuid.php ${DATA_DIR}/opt/unetlab/scripts/
cp -a scripts/remove_uuid.sh ${DATA_DIR}/opt/unetlab/scripts/
cp -a scripts/import_iou-web.php ${DATA_DIR}/opt/unetlab/scripts/
cp -a scripts/fix_iol_nvram.sh ${DATA_DIR}/opt/unetlab/scripts/
cp -a IOUtools/iou_export ${DATA_DIR}/opt/unetlab/scripts/
Expand Down
37 changes: 37 additions & 0 deletions scripts/remove_uuid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

if [ $# -ne 1 ]; then
echo 'ERROR: wrong options given.'
exit 15
fi

if [ ! -f ${1} ]; then
echo 'ERROR: file does not exist.'
exit 15
fi

TEMP=$(mktemp -d --suffix=_unetlab)
unzip -q -o -d ${TEMP} ${1} "*.unl"
if [ $? -ne 0 ]; then
rm -rf ${TEMP}
echo 'ERROR: cannot unzip file.'
exit 15
fi

find ${TEMP} -name "*.unl" -exec sed -i 's/ id="[0-9a-f-]\{36\}"//g' '{}' \;
if [ $? -ne 0 ]; then
rm -rf ${TEMP}
echo 'ERROR: cannot remove lab UUID.'
exit 15
fi

cd ${TEMP}

zip -q -r -u ${1} *
if [ $? -ne 0 ]; then
rm -rf ${TEMP}
echo 'ERROR: cannot update files.'
exit 15
fi

exit 0

0 comments on commit 9b0d14c

Please sign in to comment.