diff options
Diffstat (limited to 'up2date.app/Contents')
-rw-r--r-- | up2date.app/Contents/Info.plist | 44 | ||||
-rwxr-xr-x | up2date.app/Contents/MacOS/applet | bin | 0 -> 55856 bytes | |||
-rw-r--r-- | up2date.app/Contents/PkgInfo | 1 | ||||
-rw-r--r-- | up2date.app/Contents/Resources/Scripts/main.scpt | bin | 0 -> 1748 bytes | |||
-rw-r--r-- | up2date.app/Contents/Resources/applet.icns | bin | 0 -> 40291 bytes | |||
-rw-r--r-- | up2date.app/Contents/Resources/applet.rsrc | bin | 0 -> 362 bytes | |||
-rw-r--r-- | up2date.app/Contents/Resources/description.rtfd/TXT.rtf | 4 | ||||
-rwxr-xr-x | up2date.app/Contents/Resources/up2date.sh | 47 |
8 files changed, 96 insertions, 0 deletions
diff --git a/up2date.app/Contents/Info.plist b/up2date.app/Contents/Info.plist new file mode 100644 index 0000000..5c8b161 --- /dev/null +++ b/up2date.app/Contents/Info.plist @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleAllowMixedLocalizations</key> + <true/> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>applet</string> + <key>CFBundleIconFile</key> + <string>applet</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>up2date</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>aplt</string> + <key>LSMinimumSystemVersionByArchitecture</key> + <dict> + <key>x86_64</key> + <string>10.6</string> + </dict> + <key>LSRequiresCarbon</key> + <true/> + <key>WindowState</key> + <dict> + <key>dividerCollapsed</key> + <false/> + <key>eventLogLevel</key> + <integer>-1</integer> + <key>name</key> + <string>ScriptWindowState</string> + <key>positionOfDivider</key> + <real>346</real> + <key>savedFrame</key> + <string>77 104 824 602 0 0 1440 878 </string> + <key>selectedTabView</key> + <string>result</string> + </dict> +</dict> +</plist> diff --git a/up2date.app/Contents/MacOS/applet b/up2date.app/Contents/MacOS/applet Binary files differnew file mode 100755 index 0000000..6a47312 --- /dev/null +++ b/up2date.app/Contents/MacOS/applet diff --git a/up2date.app/Contents/PkgInfo b/up2date.app/Contents/PkgInfo new file mode 100644 index 0000000..3253614 --- /dev/null +++ b/up2date.app/Contents/PkgInfo @@ -0,0 +1 @@ +APPLaplt
\ No newline at end of file diff --git a/up2date.app/Contents/Resources/Scripts/main.scpt b/up2date.app/Contents/Resources/Scripts/main.scpt Binary files differnew file mode 100644 index 0000000..5479faa --- /dev/null +++ b/up2date.app/Contents/Resources/Scripts/main.scpt diff --git a/up2date.app/Contents/Resources/applet.icns b/up2date.app/Contents/Resources/applet.icns Binary files differnew file mode 100644 index 0000000..fcc1f09 --- /dev/null +++ b/up2date.app/Contents/Resources/applet.icns diff --git a/up2date.app/Contents/Resources/applet.rsrc b/up2date.app/Contents/Resources/applet.rsrc Binary files differnew file mode 100644 index 0000000..b06b869 --- /dev/null +++ b/up2date.app/Contents/Resources/applet.rsrc diff --git a/up2date.app/Contents/Resources/description.rtfd/TXT.rtf b/up2date.app/Contents/Resources/description.rtfd/TXT.rtf new file mode 100644 index 0000000..33192ea --- /dev/null +++ b/up2date.app/Contents/Resources/description.rtfd/TXT.rtf @@ -0,0 +1,4 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 +{\fonttbl} +{\colortbl;\red255\green255\blue255;} +}
\ No newline at end of file diff --git a/up2date.app/Contents/Resources/up2date.sh b/up2date.app/Contents/Resources/up2date.sh new file mode 100755 index 0000000..40d7f75 --- /dev/null +++ b/up2date.app/Contents/Resources/up2date.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# up2date.sh +# Run software update until there are no more updates available. +# @author Filipp Lepalaan +# @package mtk + +if [[ id -u != 0 ]]; then + echo "$(basename $0) must be run as root" 2>&1 + exit 1 +fi + +ME=$0 +PLIST=/Library/LaunchDaemons/com.unflyingobject.mtk.up2date.plist + +# updates available... +if /usr/sbin/softwareupdate -l 2>&1 | grep -q 'found the following new' +then + if [[ ! -e "${PLIST}" ]]; then + cat > "${PLIST}" <<EOT +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>RunAtLoad</key> + <true/> + <key>Label</key> + <string>com.unflyingobject.mtk.up2date</string> + <key>ProgramArguments</key> + <array> + <string>${ME}</string> + </array> + </dict> +</plist> +EOT + /bin/launchctl load -w "${PLIST}" + /usr/bin/logger "$(basename $0) loaded" + exit 0 + fi + /usr/bin/open /var/log/system.log + /usr/sbin/softwareupdate -ia && /sbin/reboot + exit 0 +fi + +# no more updates available +/bin/launchctl unload -w "${PLIST}" && rm "${PLIST}" +/usr/bin/logger "$(basename $0) finished, script unloaded. Have a nice day." +exit 0 |