[BACK]Return to manage_pre CVS log [TXT][DIR] Up to [local] / palm / manage_pre

Diff for /palm/manage_pre/manage_pre between version 1.4 and 1.7

version 1.4, 2009/08/20 22:40:49 version 1.7, 2009/11/25 21:27:15
Line 1 
Line 1 
 #!/bin/sh  #!/bin/sh
 # $Id$  # $Id$
   
 local _pre_id='Palm, Pre, 0316'  local _pre_id='Palm, Pre, 0000'
 #local _pre_label='Pre'  #local _pre_label='Pre'
 #local _ipod_label='iPod'  #local _ipod_label='iPod'
 local _mount_dir='/mnt/pre'  local _mount_dir='/mnt/pre'
Line 29 
Line 29 
 find_pre() {  find_pre() {
     local _dev=`dmesg | grep 'Palm, Pre' | tail -1 | cut -d' ' -f 1`      local _dev=`dmesg | grep 'Palm, Pre' | tail -1 | cut -d' ' -f 1`
     if [ X"$_dev" == X"" ]; then      if [ X"$_dev" == X"" ]; then
             echo Pre not found! >&2          echo Pre not found! >&2
             exit 1          exit 1
     fi      fi
   
     local _id=`dmesg | grep "^$_dev at " | tail -1 | sed -e 's/.*<//' -e 's/>.*$//'`      local _id=`dmesg | grep "^$_dev at " | tail -1 | sed -e 's/.*<//' -e 's/>.*$//'`
     if [ X"$_id" != X"$_pre_id" ]; then      if [ X"$_id" != X"$_pre_id" ]; then
             echo "Pre [$_dev] not correct id [$_id]" >&2          echo "Pre [$_dev] not correct id [$_id]" >&2
             exit 2          exit 2
     fi      fi
   
     echo /dev/${_dev}i      echo /dev/${_dev}i
Line 65 
Line 65 
         return          return
     fi      fi
     $SUDO mkdir -p $_mount_dir      $SUDO mkdir -p $_mount_dir
         $SUDO chgrp users $_mount_dir      $SUDO chgrp users $_mount_dir
         $SUDO chmod g+w   $_mount_dir      $SUDO chmod g+w   $_mount_dir
     $SUDO /sbin/mount $_dev $_mount_dir && echo Mounted Pre on $_mount_dir      $SUDO /sbin/mount $_dev $_mount_dir && echo Mounted Pre on $_mount_dir
 }  }
   
 synchronize() {  synchronize() {
     local _mounted=`is_mounted $_dev`      local _mounted=`is_mounted $_dev`
       local _did_mount=""
     if [ X"" == X"$_mounted" ]; then      if [ X"" == X"$_mounted" ]; then
         echo Not mounted          mount || exit 255
         return 1          _did_mount=1
     fi      fi
   
     echo Synchronizing Pre      echo Synchronizing Pre
Line 86 
Line 87 
   
     if [ -e /usr/local/bin/unison ]; then      if [ -e /usr/local/bin/unison ]; then
         /usr/local/bin/unison $_unison_config -auto -batch -ui text          /usr/local/bin/unison $_unison_config -auto -batch -ui text
       fi
   
       if [ ! -z "$_did_mount" ]; then
           eject
     fi      fi
 }  }
   

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.7

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>