This commit is contained in:
Eric Hanko 2017-06-06 21:37:49 -07:00
Родитель 77e29b76d9
Коммит 534530fc23
3 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -28,8 +28,8 @@ property :settings, Hash
property :system, [true, false]
action :run do
if new_resource.read_only
new_resource.option = 'read'
if read_only
option = 'read'
end
settings.each do |setting, value|
execute BASE_COMMAND do

Просмотреть файл

@ -25,7 +25,7 @@ BASE_COMMAND = '/usr/bin/pmset'.freeze
property :settings, Hash
action :run do
new_resource.settings.each do |setting, value|
settings.each do |setting, value|
execute BASE_COMMAND do
command "#{BASE_COMMAND} #{setting} #{value}"
end

Просмотреть файл

@ -27,13 +27,21 @@ property :settings, Hash
property :system_setting, [true, false], default: false
action :run do
new_resource.settings.each do |flag, setting|
settings.each do |flag, setting|
execute BASE_COMMAND do
command "#{BASE_COMMAND} -set#{flag} #{setting}"
end
end
end
action :verify do
settings.each do |flag, _|
execute BASE_COMMAND do
command "#{BASE_COMMAND} -get#{flag}"
end
end
end
# Available key/value pairs to use with the systemsetup resource:
# date <mm:dd:yy>