Hi All,
I have a requirement to auto mount a smb share on the mac machine (osx 10.8.0) during startup at /Library/StartupItems/smbmount . whwre smbmount is my new directory. which contains 2 files StartupParameters.plist and smbmount.
StartupParameters.plist
{
Description = "smbmount";
Provides = ("smbmount");
Requires = ("Network");
OrderPreference = "Late";
Messages = { start = "Starting smbmount"; stop = "Stopping smbmount"; };
}
and smbmount is as below
#!/bin/sh
##
# buffy local stuff
##
. /etc/rc.common
StartService ()
{
ConsoleMessage "smbmount startup"
# this is some weird stuff that only i'm interested in
# but I'm sure you have similar weird stuff
/sbin/mount_smbfs -N //Username:'Pass-wd'@server.bc.com/builds /Volumes/Buildarchive
}
StopService ()
{
ConsoleMessage "smbmount shutdown"
umount /Volumes/Buildarchive
}
RestartService ()
{
StopService
StartService
}
RunService "$1"
This doesn't mount the smb share. The error seen in /var/log/system.log is "no route to host "
But this script works if i run it as
SystemStarter start smbmount
Could this be because network is not available when this script is run (during start up)? If so what is the other way of auto mounting this smb share? Kindly provide all minute details... as i am new to mac.
Thanks and best regards
Vijaya Nataraj
I have a requirement to auto mount a smb share on the mac machine (osx 10.8.0) during startup at /Library/StartupItems/smbmount . whwre smbmount is my new directory. which contains 2 files StartupParameters.plist and smbmount.
StartupParameters.plist
{
Description = "smbmount";
Provides = ("smbmount");
Requires = ("Network");
OrderPreference = "Late";
Messages = { start = "Starting smbmount"; stop = "Stopping smbmount"; };
}
and smbmount is as below
#!/bin/sh
##
# buffy local stuff
##
. /etc/rc.common
StartService ()
{
ConsoleMessage "smbmount startup"
# this is some weird stuff that only i'm interested in
# but I'm sure you have similar weird stuff
/sbin/mount_smbfs -N //Username:'Pass-wd'@server.bc.com/builds /Volumes/Buildarchive
}
StopService ()
{
ConsoleMessage "smbmount shutdown"
umount /Volumes/Buildarchive
}
RestartService ()
{
StopService
StartService
}
RunService "$1"
This doesn't mount the smb share. The error seen in /var/log/system.log is "no route to host "
But this script works if i run it as
SystemStarter start smbmount
Could this be because network is not available when this script is run (during start up)? If so what is the other way of auto mounting this smb share? Kindly provide all minute details... as i am new to mac.
Thanks and best regards
Vijaya Nataraj