Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- 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"
- export LANG="ru_RU.utf8"
- export USER="gudvin"
- export LOG="/tmp/log"
- export ERRORLOG="/tmp/log0"
- export DISPLAY=":0"
- export FILEMANAGER="nautilus"
- export MOUNTPOINT="/media/sie"
- echo "[info] start script" >> $LOG
- case $ID_MODEL in
- USB-Serial_Controller)
- echo "[info] checked USB-Serial_Controller" >> $LOG
- case $1 in
- add)
- echo "[info] added device: $DEVNAME, which is DCA-110 Cable " >> $LOG
- #stty 460800 -F $DEVNAME
- echo "[info] Подключено устройство DCA-110" >> $LOG
- sudo -u $USER notify-send "Подключено устройство" "Прошивочный кабель DCA-110" -i phone ;;
- remove)
- echo "[info] removed device: $DEVNAME, which is DCA-110 Cable " >> $LOG
- echo "[info] Отключено устройство DCA-110" >> $LOG
- sudo -u $USER notify-send "Отключено устройство" "Прошивочный кабель DCA-110" -i phone ;;
- *)
- echo "[err] sorry, but i don't know this action (:: $1 ::). DCA-110 Cable doesn't trigged. " >> $ERRORLOG;;
- esac ;;
- Siemens_USB_Connectivity)
- case $1 in
- add)
- echo "[info] added device: $DEVNAME, which is DCA-140 Cable " >> $LOG
- sudo -u $USER notify-send "Подключено устройство" "Data-кабель DCA-140" -i phone
- su - $USER -c 'mount mount.siefs'
- sudo -u $USER $FILEMANAGER $MOUNTPOINT 2>/tmp/lool;;
- remove)
- echo "[info] removed device: $DEVNAME, which is DCA-140 Cable " >> $LOG
- sudo -u $USER notify-send "Отключено устройство" "Data-кабель DCA-140" -i phone
- umount $MOUNTPOINT 2>/tmp/tmplog;;
- *)
- echo "[err] sorry, but i don't know this action (:: $1 ::). DCA-140 Cable doesn't trigged." >> $ERRORLOG;;
- esac;;
- *)
- echo "[err] trigged unknown device $device ($DEVNAME) [requested $1, but ignored] " >> $ERRORLOG
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement