bin/d3admin in depot3-3.0.11 vs bin/d3admin in depot3-3.0.13
- old
+ new
@@ -69,35 +69,39 @@
show_help @options.helptype
return
end
# run config if it hasn't ever run
- unless D3::Admin::Prefs.prefs[:last_config]
+ unless D3::Admin::Prefs.prefs[:last_config] || JSS.superuser?
puts
puts "******** INITIAL D3ADMIN CONFIGURATION ********"
puts
config
# but dont run it again if that's the action chosen
return if @action =~ /^c/
end
### our admin is us
- @admin = ENV['USER']
+ @admin = @options.admin || ENV['USER']
# admin can't be a badmin
if D3.badmins.include? @admin and D3::Admin::ACTIONS_NEEDING_ADMIN.include? @action
raise D3::PermissionError, "d3admin cannot do '#{@action}' as #{@admin}."
end
# config before connecting
- if @action =~ /^c/
+ if @action =~ /^c/ and !JSS.superuser?
config
return
end
### connect to the server, prompting for info as needed
- D3::Admin::Auth.connect
+ if @admin == 'root'
+ D3::Client.connect
+ else
+ D3::Admin::Auth.connect
+ end
case @action
when /^a/ then
add_pilot_package
@@ -175,10 +179,13 @@
when '--walkthru'
@options.walkthru = true
when '--auto-confirm'
@options.auto_confirm = true
+ when '--admin'
+ @options.admin = arg
+
# search and report
when '--status'
@options.status += arg.split(/,\s*/)
when '--queue'
@options.report_q = true
@@ -228,11 +235,11 @@
@options.post_remove = arg
when '--auto-groups'
@options.auto_groups = arg
when '--excluded-groups'
@options.excluded_groups = arg
- when '--prohibiting-process'
- @options.prohibiting_process = arg
+ when '--prohibiting-processes'
+ @options.prohibiting_processes = arg
when '--cpu_type'
@options.cpu_type = arg
when '--category'
@options.category = arg