<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

<!-- Process this file with docbook-to-man to generate an nroff manual
     page: `docbook-to-man manpage.sgml > manpage.1'.  You may view
     the manual page with: `docbook-to-man manpage.sgml | nroff -man |
     less'.  A typical entry in a Makefile or Makefile.am is:

whereami.8: whereami.sgml
	docbook-to-man $< > $@
  -->

  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
  <!ENTITY dhfirstname "<firstname>Andrew</firstname>">
  <!ENTITY dhsurname   "<surname>McMillan</surname>">
  <!-- Please adjust the date whenever revising the manpage. -->
  <!ENTITY dhdate      "<date>March 11, 2002</date>">
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
  <!ENTITY dhemail     "<email>debian@mcmillan.net.nz</email>">
  <!ENTITY dhusername  "Andrew McMillan">
  <!ENTITY dhucpackage "<refentrytitle>whereami</refentrytitle>">
  <!ENTITY dhpackage   "whereami">

  <!ENTITY debian      "<productname>Debian GNU/Linux</productname>">
  <!ENTITY gnu         "<acronym>GNU</acronym>">
]>

<refentry>
  <refentryinfo>
    <address>
      &dhemail;
    </address>
    <author>
      &dhfirstname;
      &dhsurname;
    </author>
    <copyright>
      <year>2002</year>
      <holder>&dhusername;</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>

    <refpurpose>non-interatively ascertain the location of the
    computer and reconfigure the system appropriately.
    </refpurpose>
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage;</command>

      <arg><option>--debug </option></arg>
      <arg><option>--scriptdebug </option></arg>
      <arg><option>--syslog </option></arg>
      <arg><option>--noactions </option></arg>
      <arg><option>--nolocking </option></arg>
      <arg><option>--mapping </option></arg>
      <arg><option>--basedir <replaceable>directory</replaceable> </option></arg>
      <arg><option>--statedir <replaceable>directory</replaceable> </option></arg>
      <arg><option>--from <replaceable>location_list</replaceable> </option></arg>
      <arg><option>--run_from <replaceable>calling_program_tag</replaceable> </option></arg>
      <arg><option>location_list</option></arg>

    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>`&dhpackage;' provides a configurable and extensible framework for
    automatic location-detection and reconfiguration of computers, typically
    laptops.</para>

  <refsect2>
    <title>Detection</title>

      <para>Detection is handled through the use of various network and hardware
      probing tools.  These tools have been wrapped in small shell scripts to interface
      them to whereami, but the end-user with different requirements may wish to
      extend these in some situations.</para>

      <para><command>&dhpackage;</command> processes the file /etc/whereami/detect.conf
    performing the tests specified in there in order to decide which location the computer is
    currently located at.</para>

    <para>For full detail on the discovery process, you should read the detect.conf (5)
    manpage.</para>

  </refsect2>

  <refsect2>
    <title>Configuration</title>

      <para>Configuration is handled through standard shell scripting.  A variety of small
      utility scripts are provided and the author is always willing to accept more.</para>

      <para>The file /etc/whereami/whereami.conf is parsed and a script built containing
       the actions specified there which are associated with the locations found during the
       detection phase.  Actions may be configured for when leaving, remaining, or
       arriving at a location.</para>

       <para>Once the script has been built, it is run to effect the necessary changes to
       the system configuration.</para>
  </refsect2>

  </refsect1>
  <refsect1>
    <title>OPTIONS</title>

    <para>This program follows the modern command-line syntax
    preceding each option with a double dash (`--').  Short form options
    are also available, but are not documented (RTFC :-)</para>

    <variablelist>
      <varlistentry>
        <term><option>--debug</option></term>
        <listitem>
          <para>Run in debugging mode.  A verbose output is provided and
          the resulting script is output to the screen and not executed.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--scriptdebug</option></term>
        <listitem>
          <para>Run in script debugging mode.  Each script supplied with `whereami'
          will `set -o xtrace' if the environment variable `DEBUGWHEREAMI' is set to
          non-blank.  This parameter will set that variable.  The script which is built by
          whereami will also respond to the environment variable.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--syslog</option></term>
        <listitem>
          <para>Output some logging information to syslog.  The 'user' facility is used for
          this, and it provides an insight into which locations whereami has chosen, and
          why.</para>
          <para>In combination with <option>--scriptdebug</option> above, this can
          be very useful for debugging your configuration.  Also note that the default
          installation turns this on for apm and init actions.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--noactions</option></term>
        <listitem>
          <para>Just do the detection and print the location name.  Don't build and run
          the script from whereami.conf.</para>
          <para>You might do this if you wanted to use <command>&dhpackage;</command>'s
          detection, but use something else for configuration.  Perhaps you could achieve the
          same end with a very simple whereami.conf, but there should always be two ways to
          do anything :-).</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--nolocking</option></term>
        <listitem>
          <para><command>&dhpackage;</command> won't normally let two copies of
           &dhpackage; run at the same time.  Use this option if you can come up with
           a scenario where you should allow this to happen!</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--mapping</option></term>
        <listitem>
          <para>This will persuade <command>&dhpackage;</command> to do only the detection
          stage, and output a list of the detected locations, suitable for use as a
          mapping script with ifupdown.  </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--hint <replaceable>locations</replaceable> </option></term>
        <listitem>
          <para>Provides some hints to the detection process.  The locations set
          by this parameter (a comma-delimited list) may be referenced by rules
          in your detect.conf.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--basedir <replaceable>directory</replaceable> </option></term>
        <listitem>
          <para>Specifies the base directory which will contain both the detect.conf and
          whereami.conf.  The default is `/etc/whereami' which should be right for normal
          use.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--statedir <replaceable>directory</replaceable> </option></term>
        <listitem>
          <para>Specifies the state directory in which <command>&dhpackage;</command> will
          write files indicating the current and previous locations (iam , iwas) and the
          script which is run for this environment (whereiam.sh).</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--from <replaceable>location_list</replaceable> </option></term>
        <listitem>
          <para>Overrides <command>&dhpackage;</command>'s knowledge of where you have come from.  The
          <replaceable>location_list</replaceable> will be a comma-separated list of the
          locations which you are leaving.</para>
          <para>Normally `<command>&dhpackage;</command>' maintains a history of locations, so that it knows
          where you have come from (and what might consequently have to be de-configured)
          as well as knowing that your location has changed.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>--run_from <replaceable>calling_program_tag</replaceable> </option></term>
        <listitem>
          <para>This provides a mechanism for calling software, such as init scripts, pcmcia startup
          or apm events, to pass some of that source information to <command>&dhpackage;</command>,
          where it is promptly ignored, at present.</para>
          <para>I have a possibly misguided idea that this might be useful somehow, but I can't think
          of any application of it at this point!</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><option>location_list</option></term>
        <listitem>
          <para>Overrides <command>&dhpackage;</command>'s testing of where you are.  The
          <replaceable>location_list</replaceable> will be a comma-separated list of the
          locations which you are now at.</para>
          <para>You might use this if you wished to bypass the detection phase, using some
          other package to handle that.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
  <refsect1>
    <title>SEE ALSO</title>

    <para>detect.conf (5), whereami.conf (5)</para>

    <para>There is some further documentation in HTML available
    in /usr/share/doc/&dhpackage;/manual</para>
  </refsect1>
  <refsect1>
    <title>FILES</title>

    <variablelist>
      <varlistentry>
        <term><filename>/etc/whereami/detect.conf</filename></term>
        <listitem>
          <para>Defines the process of detection.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><filename>/etc/whereami/whereami.conf</filename></term>
        <listitem>
          <para>Defines the actions performed as a result of entering, leaving, or remaining
          within a particular location.</para>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>
  <refsect1>
    <title>KNOWN BUGS</title>

    <para>This man page only documents the current perl version of whereami.  For backward compatibility
    with people's setups, it is possible to configure your system to run the older shell-script, which
    is currently undocumented.</para>

    <para>If you wish to switch from the shell script to the new perl program you will need to create an
    appropriate `detect.conf' file to define your location detection parameters.  Your existing whereami.conf
    file should be compatible with this version.  Once you have created a detect.conf file in /etc/whereami
    you should run `<command>dpkg-reconfigure whereami</command>' and respond to the questions.</para>
  </refsect1>
  <refsect1>
    <title>AUTHOR</title>

    <para>This manual page was written by &dhusername; &lt;&dhemail;&gt; for
      the &debian; system (but may be used by others).  Permission is
      granted to copy, distribute and/or modify this document under
      the terms of the <acronym>GPL</acronym> version 2.
    </para>

  </refsect1>
</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
