#!/bin/bash

# Script to invoke chsyscfg on arguments passed in.  This script is intended for use
# by Code Update and will invoke a chsyscfg on the HMC.
#
#Usage: chsyscfgUPD -r lpar | prof | sys | sysprof | frame
#                -m <managed system> | -e <managed frame>
#                -f <configuration file> | -i "<configuration data>"
#                [--help]
#
#Changes partitions, partition profiles, system profiles, or the attributes of a
#managed system or a managed frame.
#
#    -r                        - the type of resource(s) to be changed:
#                                  lpar    - partition
#                                  prof    - partition profile
#                                  sys     - managed system
#                                  sysprof - system profile
#                                  frame   - managed frame
#    -m <managed system>       - the managed system's name
#    -e <managed frame>        - the managed frame's name
#    -f <configuration file>   - the name of the file containing the
#                                configuration data for this command.
#                                The format is:
#                                  attr_name1=value,attr_name2=value,...
#                                or
#                                  "attr_name1=value1,value2,...",...
#    -i "<configuration data>" - the configuration data for this command.
#                                The format is:
#                                  "attr_name1=value,attr_name2=value,..."
#                                or
#                                  ""attr_name1=value1,value2,...",..."
#    --help                    - prints this help
#
#The valid attribute names for this command are:
#    -r lpar     required: name | lpar_id
#                optional: new_name, default_profile, work_group_id,
#                          ipl_source (a | b | c | d),
#                          shared_proc_pool_util_auth (0 | 1)
#    -r prof     required: name, lpar_id | lpar_name
#                optional: new_name, min_mem, desired_mem, max_mem,
#                          min_num_huge_pages, desired_num_huge_pages,
#                          max_num_huge_pages,
#                          min_procs, desired_procs, max_procs,
#                          min_proc_units, desired_proc_units, max_proc_units,
#                          min_5250_cpw_percent, desired_5250_cpw_percent,
#                          max_5250_cpw_percent, proc_mode (ded | shared),
#                          sharing_mode (share_idle_procs | keep_idle_procs |
#                          cap | uncap), uncap_weight, lpar_io_pool_ids,
#			  io_slots (drc_index/slot_io_pool_id/is_required),
#                          load_source_slot, alt_restart_device_slot, 
#                          console_slot, alt_console_slot, op_console_slot,
#                          boot_mode (norm | dd | sms | of | ds),
#                          conn_monitoring, auto_start, max_virtual_slots,
#                          virtual_opti_pool_id, hsl_pool_id,
#                          virtual_eth_adapters (slot_num/ieee_virtual_eth/
#                              port_vlan_id/addl_vlan_ids/trunk_priority/
#                              is_required),
#                          virtual_scsi_adapters (slot_num/adapter_type/
#                              remote_lpar_id/remote_lpar_name/
#                              remote_slot_num/is_required),
#                          virtual_serial_adapters (slot_num/adapter_type/
#                              supports_hmc/remote_lpar_id/remote_lpar_name/
#                              remote_slot_num/is_required),
#                          power_ctrl_lpar_ids | power_ctrl_lpar_names,
#                          hca_adapters (adapter_id/guid/capability),
#                          sni_device_ids, work_group_id,
#                          redundant_err_path_reporting
#    -r sys      optional: new_name, power_off_policy (0 | 1),
#                          service_lpar_id, service_lpar_name,
#                          power_on_option (autostart | standby),
#                          power_on_side (perm | temp),
#                          power_on_speed (slow | fast),
#                          power_on_speed_override (none | slow | fast),
#                          sp_failover_enabled (0 | 1)
#    -r sysprof  required: name
#                optional: new_name, lpar_ids | lpar_names, profile_names
#    -r frame    optional: new_name, frame_num
#
# Exit status = 0 if no errors occur; non-zero otherwise.
#
# Module History:
# 00 08/03/2006  E. Leet     Initial release
# 01 09/26/2006  M. Antes    572107 - exit with return code from command

actzTrace "ESA    T: -> chsyscfgUPD $*"

/opt/hsc/bin/chsyscfg $*
cmdRC=$?

actzTrace 'ESA    T: <- chsyscfgUPD'

exit $cmdRC
