Initscript

Initscripts execute inittab commands.

To run an initscript on PlanetLab Europe. Run the following:

>>> body
#!/bin/bash

#Installation script for automatically deploying the DIMES agent on a PL sliver

touch vinitrun.txt

echo "Installing wget"
WDL=$(sudo yum -y install wget |grep -c -E 'Nothing|Complete')
until [[ "$WDL"=="1" ]]
do
sleep 10
WDL=$(sudo yum -y install wget |grep -c -E 'Nothing|Complete')
done

echo "Dimes Agent 0.5.1 installing..."

echo "Changing to tmp directory"
cd /tmp

echo "Downloading tarball"
DL=$(wget --tries=10 http://www.netdimes.org/dimes.agent.0.5.1.tar.gz -o log)

until [[ ! -z "`grep saved log`" ]]
do
sleep $(($RANDOM % 3600))
DL=$(wget --tries=10 http://www.netdimes.org/dimes.agent.0.5.1.tar.gz -o log)
done

until [[ "`/usr/bin/du dimes.agent.0.5.1.tar.gz`" > "20460" ]]
do
echo "Downloading tarball"
sleep $(($RANDOM % 3600))
DL=$(wget --tries=10 http://www.netdimes.org/dimes.agent.0.5.1.tar.gz -o log)
done

echo "Unpacking tarball"
tar -xzf dimes.agent.0.5.1.tar.gz

echo "Changing to install directory"
cd Dimes_Agent_Install

echo "Running Agent Installation"
sudo ./install_agent.sh