-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmac_prefs.rb
35 lines (30 loc) · 1.18 KB
/
mac_prefs.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
dep 'finder shows hidden files' do
met? {
!!(`defaults read com.apple.finder AppleShowAllFiles` =~ /TRUE/)
}
meet {
shell('defaults write com.apple.finder AppleShowAllFiles TRUE')
}
end
computer_name = 'Dancers Air'
bonjour_name = 'Dancers-Air'
hostname = 'dancers-air'
dep 'dancers airs computer name set' do
met? { !!(`scutil --get ComputerName`.match(computer_name)) }
meet { shell("scutil --set ComputerName '#{computer_name}'", :sudo => true) }
after { `dscacheutil -flushcache` }
end
dep 'dancers airs bonjour name set' do
met? { !!(`scutil --get LocalHostName`.match(bonjour_name)) }
meet { shell("scutil --set LocalHostName '#{bonjour_name}'", :sudo => true) }
after { `dscacheutil -flushcache` }
end
dep 'dancers airs hostname set' do
met? { !!(`scutil --get HostName`.match(hostname)) }
meet { shell("scutil --set HostName '#{hostname}'", :sudo => true) }
after { `dscacheutil -flushcache` }
end
dep 'system software is up to date' do
met? { !(shell('softwareupdate -l', :sudo => true, :spinner => true).include? 'Software Update found the following new or updated software') }
meet { shell 'softwareupdate -i -a', :sudo => true, :spinner => true }
end