• Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment,  Ubuntu,  Unix

    Automatic Script Updates

    Yesterday I posted about Randomizing the Software Update Server for Mac OS X. I posted the script, which I called randomsus.sh at https://krypted.com//Scripts/randomsus.sh. But, what if you wanted to update the Software Update Server list in the script automatically using your own URL (ie – on a timed interval)? In this case, you could simply use the following script, which pulls a new copy of the randomsus.sh script from the site: #!/bin/bash URL=”https://krypted.com//Scripts/randomsus.sh” PATH=”/Scripts/randomsus.sh” /usr/bin/curl $URL > $PATH exit 0 Notice that I made the URL and PATH variables. This is really just to make it easier to use if others choose to do so. It would also be pretty…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    Randomizing the Mac OS X Software Update Server

    I’ve had a few instances where there was no way to setup round robin DNS or a load balancer and we were looking to alternate between a bunch of software update servers.  In order to do so, I’ve written a quick shell script to do so.  Here it is, in pieces, so it makes sense. The following is a quick script to pull a URL from a random list of servers: #!/bin/bash Sus=”http://swupd.krypted.com:8088 http://sus.krypted.com:8088 http://sus1.krypted.com:8088 http://sus2.krypted.com:8088 http://sus3.krypted.com:8088 http://sus4.krypted.com:8088 http://sus5.krypted.com:8088 http://sus6.krypted.com:8088 http://sus7.krypted.com:8088 http://sus8.krypted.com:8088 http://sus9.krypted.com:8088 http://sus10.krypted.com:8088″ sus=($Sus) num_sus=${#sus[*]} echo -n ${sus[$((RANDOM%num_sus))]} exit 0 This script would simply write to the screen one of the software update servers that we’ve loaded up into…