Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to check software updates on LAN machines Network
If you have a remote server (like an XServe) or other Macs on the LAN, and you need to know when you need to update the system, maybe the following AppleScript may help you. It checks to see if there is a software update from Apple and send you an email.

Read the rest of the hint for the script.

[robg adds: If this sort of thing is of interest to you, then this hint, and particularly the associated comments, are probably worth reading, too.]

set subjectmail to "Software Update from Xserve" 
set mailxserve to "youremail@xserve" 
set myname to "My name" 
set mail to "youremail@work" 

--- change xxx.xxx.xxx.xxx to a IP address or webserver
--- you like better i.e. www.apple.com  ---- 
set ping_result to (do shell script "ping -c 1 xxx.xxx.xxx.xxx") 
--- check if network is on ---- 

if "100% packet loss" is in ping_result then 
  quit 
else 
  --- check for update --- 
  try 
    set restlist to do shell script "softwareupdate -l" 
  end try 
  if "Your software is up to date" is not in restlist then 
    --- send an emil if a new update is found --- 
    tell application "Mail" 
      set newMessage to make new outgoing message with ¬
       properties {subject:subjectmail, content:restlist & return & return}
       tell newMessage 
        set visible to false --- true if u wanna see mail sending mail 
        set sender to mailxserve 
        make new to recipient at end of to recipients with ¬
         properties {name:myname, address:mail}       end tell 
      send newMessage 
    end tell 
    ---- You can add more actions here ---- 
  end if 
end if 
You can save this script as an application, and schedule once or more a day with iCal.
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,277 views]  

A script to check software updates on LAN machines | 2 comments | Create New Account
Click here to return to the 'A script to check software updates on LAN machines' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An idea to improve this script
Authored by: katok on Oct 15, '04 11:34:03AM

This script can be very usefull but another idea should be to insert the email of the real sender if you make it run on every Mac in a network. The administrator of this network could know witch macintosh as to be updated and he could do it through ARD for exemple... I'm a administrator, I tried this script and I don't know how to do this ;))

---
So happy to work on Macintosh



[ Reply to This | # ]
An idea to improve this script
Authored by: club60.org on Oct 28, '04 08:14:01AM

Just remove the line "set sender to mailxserve"



[ Reply to This | # ]