Mac OS X: 实用脚本程序(bash scripts)系列-6
最后更新于:2022-04-01 10:54:24
# Login/Logout Hook脚本绑定SMB共享
可以使用Apple scripts:
<table id="i-gi" border="1" cellspacing="0" cellpadding="3" width="100%" bordercolor="#000000"><tbody><tr><td width="100%">sudo -u ${1} osascript << EOF<br/>mount volume smb://${user}:${password}/${server}/${share}/${path}<br/>EOF</td></tr></tbody></table>
或者是bash shell:
<table id="xoeq" border="1" cellspacing="0" cellpadding="3" width="100%" bordercolor="#000000"><tbody><tr><td width="100%">mkdir /Users/${1}/tmpshare<br/>chown ${1} /Users/${1}/tmpshare<br/>sudo -u ${1} mount_smbfs //${1}:${2}@server/share/${1} /Users/${1}/tmpshare</td></tr></tbody></table>