SoftwareUpdateCheck.sh
Content
About SoftwareUpdateCheck.sh
SoftwareUpdateCheck.sh list the software updates that may be fetched thorught “Software Update...”. Since the Adobe Flash-plugin has seen som many security issues for quite some time, there is an option, -f
, that shows if there is a new Flash-plugin available.
Typical user of this script are all those who no longer is running their machines as an admin-user and thus no longer get the information about software updates (from Apple). Although you may run it in a Terminal-window, it's intended to be run together with GeekTool and display the output on the desktop.
The script checks for software updates every 6 houres and updates itself every two weeks. If open_ports.sh
is running on the machine, SoftwareUpdateCheck.sh
use the data generated by open_ports.sh
. You typically have GeekTool run every 15 minutes.
If no updates are available, it looks like this:
Use
Options: | |
-f | Shows the status of the Adobe Flash plugin |
-u | Update the scriptet. Since it's located in /usr/bin you need to be root to do this |
-t | Forceful creation of data |
-h | Help. Shows this text |
Example from Terminal.app:$ SoftwareUpdateCheck.sh
Hostname: paravel.cs.lth.se (130.235.16.211) Running: Mac OS X 10.6.7 Uptime: 4 days
Software update check performed at: 9 Maj 10:31
No system software updates found
Installation
- Get the script from http://fileadmin.cs.lth.se/cs/Personal/Peter_Moller/scripts/SoftwareUpdateCheck_install.sh
- Start Terminal.app
- Become
root
: if you are an ordinary user, typesu adminanvändarnamn
and thensudo -i
; if you are an admin-user just typesudo -i
- Set the access rights for the downloaded script:
chmod 755 SoftwareUpdateCheck_install.sh
- Run the script:
./SoftwareUpdateCheck_install.sh
- Installation is usually quite quick. If you don't have GeekTool installed, it will be fetched as well. To install it, double-click it's .PrefPane
- In GeekTool: click the icon named “Shell” and drag it to an empty part of the desktop and make it the size you like.
- In the “Properties”-window, enter:
- Command:
SoftwareUpdateCheck.sh
- Refresh every: 900 s
- Change font and color as you like
- Command:
- Close GeekTool
The script is now running and will automatically launch after a reboot!
Manual installation
Put SoftwareUpdateCheck.sh
in /usr/bin
and se.lth.cs.softwareupdatecheck.plist
in /Library/LaunchDaemons
.
The, start (as root
) tha letter with launchctl
:launchctl load /Library/LaunchDaemons/se.lth.cs.softwareupdatecheck.plist
(make sure the file is owned by root and has access rights
launchctl start se.lth.cs.softwareupdatecheck644
)
Updating
The script will automatically update itself every two weeks (14 days) but you may do it manually as well:
as root
in a terminal-shell, type:SoftwareUpdateCheck.sh -u
It will then fetch the latest version of the script and install it (if it is different than the version you have installed – otherwise it will tell you).
Alternatively you may do this by yourself as root
(make sure you have a working Internet connection, though):curl fileadmin.cs.lth.se/cs/Personal/Peter_Moller/scripts/SoftwareUpdateCheck.sh > /usr/bin/SoftwareUpdateCheck.sh
chmod 755 /bin/SoftwareUpdateCheck.sh
Description of the components
/usr/bin : | |
SoftwareUpdateCheck.sh | The script that is being used both to gather data and display them |
/Library/LaunchDaemons : | |
se.lth.cs.softwareupdatecheck.plist | Control-script for launchd ; makes open_ports.sh run every 900 second to gather data |
/tmp : | |
swu.temp | Data file containing the available updates (from softwareupdate ). |
ExternIP.txt | The external IP-address of the computer |