Advertisement
Guest User

Untitled

a guest
Jan 9th, 2011
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.26 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. export PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin::/usr/bin/perlbin/vendor:/usr/lib/perl5/core_perl/bin:/home/gudvin/.bin"
  4. export LANG="ru_RU.utf8"
  5. export USER="gudvin"
  6. export LOG="/tmp/log"
  7. export ERRORLOG="/tmp/log0"
  8. export DISPLAY=":0"
  9. export FILEMANAGER="nautilus"
  10. export MOUNTPOINT="/media/sie"
  11.  
  12. echo "[info] start script" >> $LOG
  13.  case $ID_MODEL in
  14.     USB-Serial_Controller)
  15.        echo "[info] checked USB-Serial_Controller" >> $LOG
  16.        case $1 in
  17.             add)
  18.                 echo "[info] added device: $DEVNAME, which is DCA-110 Cable " >> $LOG
  19.                 #stty 460800 -F $DEVNAME
  20.                 echo "[info] Подключено устройство DCA-110" >> $LOG
  21.                 sudo -u $USER  notify-send "Подключено устройство" "Прошивочный кабель DCA-110" -i phone ;;
  22.             remove)
  23.                 echo "[info] removed device: $DEVNAME, which is DCA-110 Cable " >> $LOG
  24.                 echo "[info] Отключено устройство DCA-110" >> $LOG
  25.                 sudo -u $USER  notify-send "Отключено устройство" "Прошивочный кабель DCA-110" -i phone ;;
  26.             *)
  27.                 echo "[err] sorry, but i don't know this action (:: $1 ::). DCA-110 Cable doesn't trigged. " >> $ERRORLOG;;
  28.         esac ;;
  29.     Siemens_USB_Connectivity)
  30.        case $1 in
  31.             add)
  32.                 echo "[info] added device: $DEVNAME, which is DCA-140 Cable " >> $LOG
  33.                 sudo -u $USER  notify-send "Подключено устройство" "Data-кабель DCA-140" -i phone
  34.                 su - $USER -c 'mount mount.siefs'
  35.                 sudo -u $USER $FILEMANAGER $MOUNTPOINT 2>/tmp/lool;;
  36.             remove)
  37.                 echo "[info] removed device: $DEVNAME, which is DCA-140 Cable " >> $LOG
  38.                 sudo -u $USER  notify-send "Отключено устройство" "Data-кабель DCA-140" -i phone
  39.                 umount $MOUNTPOINT 2>/tmp/tmplog;;
  40.             *)
  41.                 echo "[err] sorry, but i don't know this action (:: $1 ::). DCA-140 Cable doesn't trigged." >> $ERRORLOG;;
  42.         esac;;
  43.     *)
  44.         echo "[err] trigged unknown device $device ($DEVNAME) [requested $1, but ignored] " >> $ERRORLOG
  45. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement