~ubuntu-branches/ubuntu/trusty/giarpfanoa/trusty

« back to all changes in this revision

Viewing changes to src/11-prep-if-mac.mod

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2003-07-11 12:08:43 UTC
  • Revision ID: james.westby@ubuntu.com-20030711120843-kekc8bw6snqz72c4
Tags: 0.1.1
* Fixed module loading.
* Added config to install target.
* Various other bugfixes so that the tool is really useful.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Starting with the most hardware close things. When the target is a MAC
 
2
# address.
 
3
if echo "$TARGET" | $IFGREP "^$H$C$H$C$H$C$H$C$H$C$H\$" ; then
 
4
    # Normally is should be appended but this is the first time so it is
 
5
    # not needed.
 
6
#    echo "MAC $TARGET"
 
7
    othermac $TARGET
 
8
    MAC=$UMACN
 
9
    ETTLMAC=$(sudo ettercap -Nl | grep $UMACN)
 
10
    if [ ! -z "$ETTLMAC" ] ; then
 
11
        TMP=$(echo "$ETTLMAC" | $SED "s/^[[:space:]]*[0-9][0-9]*.[[:space:]][[:space:]]*//;")
 
12
        IP=$(echo "$TMP" | $SED "s/[[:space:]].*//;")
 
13
        DNS=$(echo "$TMP" | $SED "s/.*[[:space:]]//g;")
 
14
        if [ -z "$DNS" ] ; then
 
15
            TARG=$IP
 
16
        else
 
17
            TARG=$DNS
 
18
        fi
 
19
    fi
 
20
fi