使用ARD UNIX命令设置计算机信息字段

时间:2012-06-08 17:15:16

标签: macos unix redirect

我正在尝试使用以下命令更改OS X计算机的计算机信息字段:

    system_profiler SPAirPortDataType | awk '/MAC Address:/{print $NF}' | /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -computerinfo -set1 -1

我遇到问题并且知道上述情况不对。有谁知道更好的方法吗?

2 个答案:

答案 0 :(得分:1)

没关系我弄清楚了:

 sudo defaults write /Library/Preferences/com.apple.RemoteDesktop \Text1 $(system_profiler SPAirPortDataType | awk '/MAC Address:/{print $NF}')

使用后重启:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console

答案 1 :(得分:0)

对于那些感兴趣的人,这是另一种方式:

/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -computerinfo -set1 -1 $(system_profiler SPAirPortDataType | awk '/MAC Address:/{print $NF}')