71
Meshstart
#!/usr/bin/perl
# Check to see if there is a cd-rom drive is mountable and see if there is
# a meshstart.conf file on it.
$cdrom = `cat /proc/sys/dev/cdrom/info|grep \"drive name\"|sed \"s/.*:\\s*//\"`;
chomp($cdrom);
$path_to_config = "/home/mesh/meshstart";
if ($cdrom ne "")
{
print ("trying to mount cdrom on dev $cdrom");
$mounted = `mount -t iso9660 \/dev\/$cdrom \/mnt\/cdrom`;
$rc = $?;
print ("rc: $rc \n");
sleep(5);
if ($rc == 0)
{
if (-e "/mnt/cdrom/meshstart.conf")
{
$path_to_config = "/mnt/cdrom";
print ("Using configuration file on cdrom\n");
}
}
}
print ("Using $path_to_config/meshstart.conf as config file\n");
require "$path_to_config/meshstart.conf";
if ($cdrom ne "")
{
$mounted = `umount /mnt/cdrom`;
}
#----------------------------------------------------------------------#
# Start up script for our thesis project.
#
# Uses meshstart.conf which it assumes is in the same directory
#
# Sets up the following, in order:
#
# 1. configure the wireless cards:
# - configures the mesh device
# - if the CLIENT_DEV value is set in the config file, this
Commentaires sur ces manuels