Alvin Murphy wrote:

> I can connect to the other machines by
> smbmount, but since this is a laptop, I would like to be able to copy
> the files to carry with me.

Automount might be a solution for ya.
Here's my (sloppy?) setup:

attached rc.auto_mount would goto /etc/rc.d, it's the start / stop / restart 
script
it looks for config files in /etc/auto_mount (make sure those config files are only readble by the user that start automount)
here's an example of the config files:

win1.auto
==================
OUNTPOINT=/mnt/winmachine1
TIMEOUT=60
==================

win1.map
==================
c -fstype=smbfs,username=JD,password=passwerd     ://winmachine1/C\$
root -fstype=smbfs,username=JD,password=passwerd  ://winmachine1/root
==================
please notice the \ before $, its an escape character, not knowing it is supposed to be there caused me lots of headaches!

and then u can make nice little links (shotcuts) to /mnt/winmachine1/c on your KDE desktop. every time u (or an application) access the directory it will mount the share and dismount it after u dont access it for a minute

eh.. make sure you have automount installed
#!/bin/bash

autofs_start() {
    for mountspec in $(/bin/ls /etc/auto_mount/*.auto)
        do
        source $mountspec
        MOUNT_BASE=${mountspec%.auto}
        echo -e "\nStarting automount for group ${MOUNT_BASE##*/}  ..."
        /usr/sbin/automount --timeout=${TIMEOUT} $MOUNTPOINT file \
        $MOUNT_BASE.map
    done        
}

autofs_stop() {
    echo -en "Stopping automount ..."
    /bin/killall -USR1 automount
    /bin/killall automount
}

autofs_restart() {
    $0 stop
    sleep 1
    $0 start
}

case "$1" in
'start')
    autofs_start
    ;;
'stop')
    autofs_stop
    ;;
'restart')
    autofs_restart
    ;;
*)
    echo "Usage: $0 <start|stop|restart>"
esac

Reply via email to