私たちは一度にシャットダウンしたい9個のMacのネットワークを持っています。 今私はこのAppleScriptを使用していますが、わかるようにSSHを使用してコンピュータを1つずつシャットダウンします。そのうちの1人が既にダウンしている場合は、スクリプトがフリーズします。 一度にすべてのMacをシャットダウンする方法はありますか?複数のMacを一度に遠隔からリブートする
あなたは、単に接続のsshにタイムアウトを設定することができset finalIP to 100
repeat until finalIP is 109
tell application "Terminal"
activate
set success to 0
do script "echo Rebooting.."
do script "ssh -l username 192.168.1." & finalIP in front window
delay 1
repeat until success = 1
if last word of (contents of front window as text) = "no" then
do script "yes" in front window
delay 1
else if last word of (contents of front window as text) = "password" then
do script "password" in front window
set success to 1
do script "echo About to reboot.." in front window
else
delay 1
end if
end repeat
do script "sudo reboot" in front window
repeat until last word of (contents of front window as text) = "password"
delay 1
end repeat
do script "password" in front window
close front window
end tell
set finalIP to finalIP + 1
delay 1
end repeat
tell application "Terminal" to quit