Announcement

Collapse
No announcement yet.

help needed mount playbook automatically

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help needed mount playbook automatically

    Had script below working in fedora to access a blackberry playbook when plugged in. The script on fedora was put into /etc/NetworkManager/dispatcher.d/ directory. When the playbook is plugged in it is automatically mounted. However, can not get it to work in Kubuntu. This command works from command line 'sudo mount -t cifs -o username=playbook,password=***,rw //169.254.0.1/media /mnt/playbook '
    ifconfig
    usb0 Link encap:Ethernet HWaddr 72:d4:f2:43:b4:9f
    inet addr:169.254.0.2 Bcast:169.254.0.3 Mask:255.255.255.252


    Script NB username and password are not included

    #!/bin/bash

    IFACE=usb0
    MOUNTPOINT=/mnt/playbook
    MOUNTOPT="username=****,password=***,uid=***"

    if [ "$1" != "$IFACE" ]; then
    exit 0
    fi

    function check_mount() {
    MOUNTED=$(mount |grep "on $MOUNTPOINT type")
    test -n "$MOUNTED" && exit 0
    }

    function mount_device() {
    IFS=. i=($(ifconfig $IFACE|grep "inet "|awk '{print $2}'))
    unset IFS

    n=${i[3]}
    let n--
    IP=${i[0]}.${i[1]}.${i[2]}.$n

    mount.cifs -o $MOUNTOPT //${IP}/media $MOUNTPOINT
    }

    case "$2" in
    'up')
    check_mount
    mount_device;;
    'down') ;;
    esac

    exit 0

    #2
    Couple of related questions to above

    1 Are there any commands to check if NetworkManager-dispather script is being called and any error messages.
    like in fedora systemctl status NetworkManager-dispatcher

    2 Is there equivalent in kubuntu to /lib/dhcpcd/dhcpcd-hooks/

    Comment


      #3
      Have you tried this? http://shkspr.mobi/blog/2012/04/blac...h-screenshots/

      It look like the playbook mimics a network server instead of a thumb drive type connection? How annoying. Once you get it connecting, you might have to write a udev rule to make it automagically mount.

      Please Read Me

      Comment


        #4
        or enable "Automatic mounting of removable devices" in system settings.

        Please Read Me

        Comment


          #5
          Originally posted by oshunluvr View Post
          Have you tried this? http://shkspr.mobi/blog/2012/04/blac...h-screenshots/

          It look like the playbook mimics a network server instead of a thumb drive type connection? How annoying. Once you get it connecting, you might have to write a udev rule to make it automagically mount.
          Thanks for reply. I read that link however got stuck on ' To connect to the PlayBook, click on "Places" then "Connect to server". Select the server type to be "Windows Share". Enter the IP address of the PlayBook (found from the PlayBook's About menu).'

          In Kubuntu where is 'Connect to server'?

          I wouldn't know how to write a udev rule . The playbook is recognised as a network wired connection and is given an ip address.

          Comment


            #6
            Originally posted by oshunluvr View Post
            or enable "Automatic mounting of removable devices" in system settings.
            This did'nt do anything at all.

            Comment


              #7
              Got the Connect to server by install nautilus and that worked ok. Can I not do this in Kubuntu without install nautilus which did not go into the k menu and I had to launch it in terminal.

              However I would still prefer if I could get playbook mounted when plugged in as in first post thru the usb interface.

              Comment


                #8
                Dolphin has a "Network" option. You should be able to add it to fstab too. Autofs might do it, but I don't use it so I can't say for sure.

                The issue is it's not really a pluggable USB device. It's a network device that use the USB port to connect to the network. Not really a standard thing to do. You're likely the only Playbook owner on here. You might get better help on a playbook forum searching for other Ubuntu users.

                Please Read Me

                Comment

                Working...
                X