Auto Mount a SMB Share at Boot On Mac OS X
As part of PaperCut’s Print Archiving feature on a Mac OS X secondary server you may need to automatically mount a SMB share so that the PaperCut Print Provider can provide the appropriate files for archiving by the PaperCut Application Server.
We have had an elegant solution presented to us by one of our customers - Sam from MacKillop College in Australia.
#!/bin/bash # Source variables from print-provider.conf . /Applications/PaperCut\ MF/providers/print/mac/print-provider.conf # Log in as local PaperCut account and execute all following commands as this user su papercut << EOS # Create a folder to mount to mkdir $ArchiveDir # Mount the share mount -t smbfs //$ArchiveUser:$ArchivePass@$ApplicationServer/archive $ArchiveDir EOS
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.papercut.maparchive.plist</string> <key>ProgramArguments</key> <array> <string>/path/to/papercutmount.sh</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist>
ArchiveDir=/Volumes/archive ArchiveUser=svc-papercut ArchivePass=PASSWORD
Keywords: TODO keywords here if needed