Changeset 9777


Ignore:
Timestamp:
Dec 14, 2011, 4:51:46 PM (13 years ago)
Author:
rick
Message:

By making directories the data should be more easy to parse..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/import_scan_data.sh

    r9690 r9777  
    3737  echo "# warning automatic ssh key $SSH_KEY not readable"
    3838  SSH_KEY_OPT=''
    39   SSH_USER=${SSH_USER:-$SUDO_USER}
     39  SSH_USER=${SSH_USER:-${SUDO_USER:-$USER}}
    4040fi
    4141rsync -O --out-format="%n%L" -az -e "ssh $SSH_KEY_OPT -l $SSH_USER -o StrictHostKeyChecking=no" tyan.wirelessleiden.nl:/usr/local/www/webfolder/scan-data/ $DATAROOT
    4242
    43 
    4443debug "# unzip compressed .tar.gz files"
    4544for FILE in `find $DATAROOT -name '*.tar.gz' | sort`; do
    46   TARDIR=`dirname $FILE`
    47   tar -C $TARDIR -xkzf $FILE
     45  TARDIR=`dirname $FILE`/`basename $FILE .tar.gz`
     46  if [ ! -d $TARDIR ]; then
     47    mkdir $TARDIR
     48    tar -C $TARDIR -xvzf $FILE
     49  fi
    4850done
    4951
    5052debug "# unzip compressed .zip files"
    5153for FILE in `find $DATAROOT -name '*.zip' | sort`; do
    52   ARCHIVEDIR=`dirname $FILE`
    53   (cd $ARCHIVEDIR; unzip -qn $FILE )
     54  ARCHIVEDIR=`dirname $FILE`/`basename $FILE .zip`
     55  if [ ! -d $ARCHIVEDIR ]; then
     56    mkdir $ARCHIVEDIR
     57    (cd $ARCHIVEDIR; unzip -qn $FILE )
     58  fi
    5459done
    5560
     
    6570    ARGS="-g $USERNAME -e $USERNAME@wirelessleiden.nl -k $DEVICE"
    6671
     72    # DroidStumber imports
     73    FILES=`find $DEVICEDIR -name 'ScanResult-*'`
     74    [ -n "$FILES" ] && $MANAGE import_datafile $ARGS $FILES
     75
    6776    #Kismet gpsxml Imports
    6877    FILES="`find $DEVICEDIR -name '*gpsxml*'`"
    69     [ -n "$FILES" ] && $MANAGE import_datafile $ARGS $FILES
    70 
    71     # DroidStumber imports
    72     FILES=`find $DEVICEDIR -name 'ScanResult-*'`
    7378    [ -n "$FILES" ] && $MANAGE import_datafile $ARGS $FILES
    7479
Note: See TracChangeset for help on using the changeset viewer.