Firstboot Script Commands

From AFP548 Wiki
Revision as of 16:14, 25 August 2010 by (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

# First Boot script that is used along with a launchd item.  Delets both itself and the launchd item after completion.

# Define 'kickstart' and'systemsetup' variables, built in OS X script that activates and sets options for ARD.
# Defines the location of the generic.ppd in OS X 10.6


# Delete iMovie (Previous Version) Directory if it exists, because we don't need it.  Use when installing iLife using the original installers with InstaDMG.
rm -R /Applications/iMovie\ \(previous\ version\).localized/

# ARD Configuration
#Enable ARD for localadmin
$kickstart -configure -allowAccessFor -specifiedUsers
$kickstart -activate -configure -access -on -users "localadmin" -privs -all -restart -agent

# Set time zone and time server.
$systemsetup -setusingnetworktime on
$systemsetup -settimezone America/New_York -setnetworktimeserver

#Update NTP
ntpdate -bvs

#Disable Airport
networksetup -setnetworkserviceenabled AirPort off

# Activate WakeOnLAN.
$systemsetup -setwakeonnetworkaccess on

#Kerberos-Enabled SSH Authentication.  Also specifies which specific groups are allowed to ssh.
echo KerberosAuthentication yes >> /etc/sshd_config
echo KerberosOrLocalPasswd yes >> /etc/sshd_config
echo AllowGroups domaingroup admin >> /etc/sshd_config

#disable ipv6
networksetup -setv6off Ethernet

#Firewall Settings | 0 = Off | 1 = On For Specific Services | 2 = On For Essential Services
defaults write /Library/Preferences/ globalstate -int 0

#Set System Sleep Preferences | 0 = Off | 15 = 15 Min | 20 = 20 Min | etc | 
pmset sleep 0

#Sets HostName
scutil --set HostName $(scutil --get LocalHostName)

#Adds Printers
lpadmin -p "Printer Name" -L "Printer Location" -D "Printer Description" -E -v lpd://server/printqueue -P $genericppd -o printer-is-shared=false

#Removes Time Machine from the menu
defaults write DoNotOfferNewDisksForBackup 1

#Reboot in 1 minute
sleep 60

# Delete the script and the launchd item.
srm /Library/LaunchDaemons/
srm "$0"