done
}
+campaign_file=${campaign_name}.cfg
+
+> "${campaign_file}" cat <<END
+#
+# ${campaign_name}
+#
+# Scenario description R script for plotting
+END
+
+html_file=${campaign_name}.html
+cat start.html > ${html_file}
+cat >> ${html_file} <<END
+ <table id="box-table-a" summary="${campaign_name} results">
+ <thead>
+ <tr>
+ <th scope="col">Name</th>
+ <th scope="col">No. of Seeders</th>
+ <th scope="col">No. of Leechers</th>
+ <th scope="col">Bandwidth Rectrictions</th>
+ <th scope="col">Graphs</th>
+ </tr>
+ </thead>
+ <tbody>
+END
+
while IFS="," read exp_no num_seeders num_leechers num_peers num_conn down_bw up_bw data_size description; do
this_conn=$(parse_conn $num_conn)
this_down_bw=$(parse_bw $down_bw)
this_up_bw=$(parse_bw $up_bw)
this_seed_torrent=$(parse_file $data_size)
+ # generate test scenario
generate_scenario "$exp_no" "$num_seeders" "$num_leechers" "$this_conn" "$this_down_bw" "$this_up_bw" "$this_seed_torrent" "$description" > "${campaign_name}-${exp_no}".cfg
+
+ # update campaign configuration file
+ echo -e "${campaign_name}-${exp_no}.cfg\t${campaign_name}-${exp_no}.R" >> "${campaign_file}"
+
+ # update campaign HTML file
+ cat >> ${html_file} <<END
+ <tr>
+ <td>${campaign_name}-${exp_no}</td>
+ <td>${num_seeders}</td>
+ <td>${num_leechers}</td>
+ <td>TODO</td>
+ <td><a href="${campaign_name}/${campaign_name}-${exp_no}.png">dlspeed vs percent</a>; <a href="${campaign_name}/${campaign_name}-${exp_no}.png">dlspeed vs time</a></td>
+ </tr>
+END
done < $input
+
+cat >> ${html_file} <<END
+ </tbody>
+ </table>
+END
+
+cat end.html >> ${html_file}