I have a smb connection between 2 machines that absolutely HAS to be open at all times. 5 minutes downtime is no problem, 30 minutes downtime would be.
With help from this forum and the man page I came up with this script that I intend to run via cron every ten minutes or so:
#!/bin/bash
if [ ! -f /Volumes/PUBLIC/testfile ]
then
mount_smbfs -U Administrator:Open171 //Administrator@192.168.12.12/PUBLIC /Volumes/PUBLIC
fi
exit 0
The problem: When the connection is not there, the directory /PUBLIC is not there. When I run this script in that case, it barks at me: "Can;t find directory /Volumes/PUBLIC. Which, of course, is why I am running this.
What am I doing wrong?
Any help appreciated!
uli_the_knecht
06-07-2005, 04:08 PM
i tried this out and i first had to create the directory at "/Volumes/".
mkdir /Volumes/SMB_Directory/
breen
06-08-2005, 10:02 AM
I usually do something like this:
#! /bin/bash
[ ! -d ~/marketing ] && mkdir ~/marketing
smbmount //marketing/public ~/marketing -o username=breen
(If I were re-writing that scriptlet now I'd probably take the time to write the directory name as $HOME/marketing .)