Mac OS X: 实用脚本程序(bash scripts)系列-6

Login/Logout Hook脚本绑定SMB共享

可以使用Apple scripts:

sudo -u ${1} osascript << EOF
mount volume smb://${user}:${password}/${server}/${share}/${path}
EOF


或者是bash shell:

mkdir /Users/${1}/tmpshare
chown ${1} /Users/${1}/tmpshare
sudo -u ${1} mount_smbfs //${1}:${2}@server/share/${1} /Users/${1}/tmpshare

你可能感兴趣的:(Mac OS X)