<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PathSecurity.com &#187; Downloads</title>
	<atom:link href="http://www.pathsecurity.com/category/downloads/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathsecurity.com</link>
	<description>Security is a Journey, Not a Destination</description>
	<lastBuildDate>Mon, 24 Oct 2011 04:27:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=270</generator>
		<item>
		<title>Mac PreStage Script</title>
		<link>http://www.pathsecurity.com/2009/05/mac-prestage-script/</link>
		<comments>http://www.pathsecurity.com/2009/05/mac-prestage-script/#comments</comments>
		<pubDate>Wed, 27 May 2009 05:21:25 +0000</pubDate>
		<dc:creator>Rev. Richard E. Baker</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://www.pathsecurity.com/?p=133</guid>
		<description><![CDATA[I wrote this script for the the Mac OS to simplify the prestageing for a OS 10.5 deployment. I just hope parts of it can be useful to others&#8230; Its written as a basic shell script but for ease of [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>I wrote this script for the the Mac OS to simplify the prestageing for a OS 10.5 deployment. I just hope parts of it can be useful to others&#8230; Its written as a basic shell script but for ease of coding in places it calls to Applescript.  If you have any edits, ideas, or questions please post them in the comments.</p>
<p><span id="more-133"></span></p>
<blockquote><p> </p>
<p>#!/bin/sh<br />
####################################################<br />
# Pre-Stage Script.<br />
# Written by Richard Baker on 08/12/08<br />
# <br />
#<br />
# To add Installers Reference Section 9<br />
#   Packages use &#8211; installer -pkg [./path/file] -target /<br />
#   External scripts &#8211; sudo [./path/file]<br />
#<br />
# Installers are run in order.<br />
# <br />
#<br />
#############################################################<br />
#</p>
<p>#<br />
#############################################################<br />
# Section 1. Menu Screen<br />
#############################################################<br />
#<br />
clear</p>
<p>echo &#8220;Welcome to the ODIN Q39 Installation script.&#8221;<br />
echo &#8220;&#8221;<br />
echo &#8220;This script will:&#8221;<br />
echo &#8221; &#8211; Set the computer name&#8221;<br />
echo &#8221; &#8211; Configure Network settings&#8221;<br />
echo &#8221; &#8211; Enable Remote Login (SSH)&#8221;<br />
echo &#8221; &#8211; Enable Screen Saver/Sleep Password&#8221;<br />
echo &#8221; &#8211; Enable Secure Virtual Memory (will require admin password)&#8221;<br />
echo &#8221; &#8211; Enable Require Password for System Preferences&#8221;<br />
echo &#8221; &#8211; Optional VPN Install&#8221;<br />
echo &#8221; &#8211; Install and configure Tivoli&#8221;<br />
echo &#8221; &#8211; Install ARC software payload&#8221;<br />
echo &#8221; &#8211; Begin Apple Software Update (will run 2 passes)&#8221;<br />
echo &#8221; &#8211; Display HW MAC address&#8221;<br />
read -p &#8216;Do you want to continue? [y=yes] : &#8216; inputstart</p>
<p>if [[ $inputstart != "y" ]]<br />
then<br />
  exit 0<br />
fi</p>
<p>#<br />
#############################################################<br />
# Section 2. Set ECN variable<br />
#############################################################<br />
#</p>
<p>clear<br />
read -p &#8216;Please Input the correct ECN and press enter  : &#8216; inputecn</p>
<p>#<br />
#############################################################<br />
# Section 3. Set Backup Server Options (This Section moved to installer calls)<br />
#############################################################<br />
#</p>
<p>#<br />
#############################################################<br />
# Section 4. Set Network variables<br />
#############################################################<br />
#</p>
<p>read -p &#8216;Please Input Network Information [IP Address] : &#8216; inputtcp<br />
read -p &#8216;                                [Subnet Mask] : &#8216; inputsubnet<br />
read -p &#8216;                                    [Gateway] : &#8216; inputgateway<br />
echo &#8220;&#8221;<br />
echo &#8220;Installing Optional Software&#8221;<br />
echo &#8220;&#8221;<br />
read -p &#8216;Would you like to Install Cisco VPN   [y=yes] : &#8216; inputcisco</p>
<p>#<br />
#############################################################<br />
# End Variable enty.  Below is running code.<br />
#############################################################<br />
#</p>
<p>#<br />
#############################################################<br />
#</p>
<p>#<br />
#############################################################<br />
# Setting Time Zone<br />
#############################################################<br />
#</p>
<p>echo &#8220;Setting Time Zone.&#8221;<br />
sudo systemsetup -settimezone America/Los_Angeles</p>
<p>#<br />
#############################################################<br />
# Setting IP Address<br />
#############################################################<br />
#</p>
<p>echo &#8220;Setting IP address&#8221;<br />
/usr/sbin/networksetup -setmanual &#8220;Built-In Ethernet&#8221; $inputtcp $inputsubnet $inputgateway</p>
<p>echo &#8220;Setting DNS server&#8221;<br />
/usr/sbin/networksetup -setdnsservers &#8220;Built-In Ethernet&#8221; XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX</p>
<p>echo &#8220;Setting search domains&#8221;<br />
/usr/sbin/networksetup -setsearchdomains &#8220;Built-In Ethernet&#8221; foo.bar.com</p>
<p>#<br />
#############################################################<br />
# Bind to Open Directory (For Future Use)<br />
#############################################################<br />
#</p>
<p>##(<br />
### Edit this line to Correct server<br />
##odmaster=&#8221;stfumac.foo.bar.com&#8221;<br />
##<br />
##/usr/sbin/dsconfigldap -a $odmaster<br />
##/usr/bin/dscl localhost -create /Search SearchPolicy dsAttrTypeStandard:CSPSearchPath<br />
##/usr/bin/dscl localhost -merge /Search CSPSSearchPath /LDAPv3/$odmaster<br />
##/usr/bin/dscl localhost -create /Contact SearchPolicy dsAttrTypeStandard:CSPSSearchPath<br />
##/usr/bin/dscl localhost -merge /Contact CSPSSearchPath /LDAPv3/$odmaster<br />
##)</p>
<p>#<br />
#############################################################<br />
# Bind To Active Directory (For Future Use)<br />
#############################################################<br />
#</p>
<p>### Please Make sure System name is less than 15 caracters.<br />
##(<br />
### Edit below line for AD server<br />
##adserver=&#8221;foo.bar.com&#8221;<br />
##<br />
##/usr/sbin/dsconfigad -f -a odin$inputecn -domain Foo.bar.com -ou FooMAC<br />
##)</p>
<p>#<br />
#############################################################<br />
# Change Update server (For Future Use)<br />
#############################################################<br />
#</p>
<p>## Writes system wide for GUI tool<br />
#sudo defualts write /Library/Preferences/com.apple.SoftwareUpdate &lt;URL&gt;<br />
## Writes pref root user, &#8216;softwareupdate&#8217; will access specified<br />
#sudo defualts write com.apple.SoftwareUpdate &lt;URL&gt;</p>
<p>#<br />
#############################################################<br />
# Enable System preferences<br />
#############################################################<br />
#</p>
<p>echo &#8220;Setting Remote Login&#8221;<br />
systemsetup -setremotelogin on<br />
echo &#8220;Setting Screensaver Timer.&#8221;<br />
defaults -currentHost write com.apple.screensaver idleTime 900<br />
echo &#8220;Disabling Automatic Software Updates.&#8221;<br />
sudo software &#8211;schedule off<br />
echo &#8220;Killing Time Machine NagScreen&#8221;<br />
defualts write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES<br />
echo &#8220;Applying Security settings.&#8221;<br />
#Below is a Shell run applescript please do not modify<br />
(<br />
sudo touch /private/var/db/.AccessibilityAPIEnabled<br />
exec osascript &lt; returns: {require password to wake:false, class:security preferences object, secure virtual memory:false, require password to unlock:false, automatic login:false, log out when inactive:false, log out when inactive interval:60}</p>
<p> set properties to {require password to wake:true, secure virtual memory:true, require password to unlock:true, automatic login:false, log out when inactive:false, log out when inactive interval:60}</p>
<p> end tell<br />
end tell<br />
EOF<br />
)</p>
<p>#<br />
#############################################################<br />
# Toggle Bluetooth sharing<br />
#############################################################<br />
#<br />
echo &#8220;Disabling Blutooth Sharing.&#8221;<br />
(<br />
exec osascript &lt;&lt;EOF<br />
tell application &quot;System Preferences&quot; to set current pane to pane &quot;com.apple.preferences.sharing&quot;<br />
tell application &quot;System Events&quot; to tell process &quot;System Preferences&quot;<br />
  click checkbox 1 of row 11 of table 1 of scroll area 1 of group 1 of window &quot;Sharing&quot;<br />
  delay 1<br />
  if (exists sheet 1 of window &quot;Sharing&quot;) then<br />
  click button &quot;Start&quot; of sheet 1 of window &quot;Sharing&quot;<br />
  end if<br />
end tell</p>
<p>ignoring application responses<br />
tell application &quot;System Preferences&quot; to quit<br />
end ignoring<br />
EOF<br />
)</p>
<p>#<br />
#############################################################<br />
# Setting Hot Corners<br />
#############################################################<br />
#</p>
<p>echo &quot;Clearing Hot Corners.&quot;<br />
(<br />
exec osascript &lt;&lt;EOF<br />
tell application &quot;System Events&quot;<br />
 tell expose preferences<br />
  ##SCREEN CORNERS (top right screen corner, bottom left screen corner, bottom right screen corner, top right screen corner)<br />
  ##get the properties of the top right screen corner &#8212;&gt; returns: {activity:none, class:screen corner, modifiers:{command}}<br />
  set properties of the top right screen corner to {activity:none, modifiers:{command}}<br />
  set properties of the top left screen corner to {activity:none, modifiers:{command}}<br />
  set properties of the bottom right screen corner to {activity:none, modifiers:{command}}<br />
  set properties of the bottom left screen corner to {activity:none, modifiers:{command}}<br />
 end tell<br />
end tell</p>
<p>EOF<br />
)</p>
<p>#<br />
#############################################################<br />
# Setting Computer Name<br />
#############################################################<br />
#</p>
<p>echo &quot;Setting computer name&quot;<br />
/bin/hostname $inputecn<br />
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/systemsetup -setcomputername  $inputecn<br />
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -setcomputername $inputecn<br />
scutil &#8211;set ComputerName $inputecn<br />
scutil &#8211;set HostName $inputecn<br />
scutil &#8211;set LocalHostName $inputecn</p>
<p>#<br />
#############################################################<br />
# Call to Backup script.<br />
#############################################################<br />
#</p>
<p>sudo ./Installers/XXbackupsoftwareXX/InstallScript.sh</p>
<p>#<br />
#############################################################<br />
# Optional Package Installs<br />
#############################################################<br />
#</p>
<p>if [[ $inputcisco = &quot;y&quot; ]]<br />
then<br />
    installer -pkg ./Installers/Cisco/&quot;Cisco VPN Client.mpkg&quot; -target /<br />
    cp ./Installers/Cisco/Profiles/ACME.pcf /etc/opt/cisco-vpnclient/Profiles/ACME.pcf</p>
<p>fi</p>
<p>#<br />
#############################################################<br />
# Package Installers<br />
#############################################################<br />
#</p>
<p>## See Top of script for formating additional installers </p>
<p>#<br />
#############################################################<br />
# Starting Software Update (two passes)<br />
#############################################################<br />
#</p>
<p>clear<br />
echo &quot;Starting Software Update&quot;<br />
echo &quot;&quot;<br />
echo &quot;First Pass&quot;<br />
echo &quot;&quot;<br />
sudo softwareupdate -l -d -i -a<br />
echo &quot;&quot;<br />
echo &quot;&quot;<br />
echo &quot;Second Pass&quot;<br />
sudo softwareupdate -l -d -i -a<br />
 <br />
#<br />
#############################################################<br />
# Post install Information<br />
#############################################################<br />
#</p>
<p>clear<br />
echo &quot;This&quot;<br />
echo &quot;Pre-Stage&quot;<br />
echo &quot;is&quot;<br />
echo &quot;FINISHED&quot;</p>
<p>say &quot;This System is ready to deploy&quot;<br />
echo &quot;&quot;<br />
echo &quot;&quot;<br />
echo &quot;Remember to write down the HW MAC address.&quot;<br />
ifconfig en0 | grep ether<br />
echo &quot;&quot;<br />
echo &quot;&quot;<br />
echo &quot;&quot;<br />
read -p &#039;Would you like to restart the system? [y=yes] &#039; inputrestart<br />
if [[ $inputrestart != &quot;y&quot; ]]<br />
then<br />
 exit 0<br />
fi<br />
shutdown -r now</p>
<div></div>
<p> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.pathsecurity.com/2009/05/mac-prestage-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

