Commit d87e70ee authored by Mike Hibler's avatar Mike Hibler

Make it work on linux too.

More error checking.
parent 5581f5e3
#!/bin/sh
# cd from <builddir>/event/trafgen to testbed/event/trafgen
if [ -x /usr/bin/fetch ]; then
fetch=/usr/bin/fetch
elif [ -x /usr/bin/wget ]; then
fetch=/usr/bin/wget
else
echo "ERROR: tg-install: need either 'fetch' or 'wget' installed"
exit 1
fi
if [ ! -d $1/tg2.0/src ]; then
echo "Downloading tg2.0 source from www.emulab.net to $1 ..."
cd $1
fetch http://www.emulab.net/tg2.0.tar.gz
$fetch http://www.emulab.net/tg2.0.tar.gz
if [ $? -ne 0 ]; then
echo "Failed..."
echo "Downloading tg2.0 source from www.postel.org to $1 ..."
fetch http://www.postel.org/tg/tg2.0.tar.gz
$fetch http://www.postel.org/tg/tg2.0.tar.gz || {
echo "ERROR: tg-install: $fetch failed"
exit 1
}
fi
echo "Unpacking/patching tg2.0 source ..."
tar xzf tg2.0.tar.gz
patch -p0 < tg.patch
tar xzf tg2.0.tar.gz || {
echo "ERROR: tg-install: tar failed"
exit 1
}
patch -p0 < tg.patch || {
echo "ERROR: tg-install: patch failed"
exit 1
}
rm -f tg2.0.tar.gz tg2.0/*/*/*.orig
fi
exit 0
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