

#=--------------------------------------------
# DATE: Oct 14 2022, 00:10:52
# DESCRIPTION: Accept License Agreements
#=--------------------------------------------

x()
{
ERROR=`dspmsg smit.cat -s 1 668 "Failure to accept the license agreement terms
will prevent the use of this system.
"`
yes=`dspmsg smit.cat -s 30 18 "yes"`
PRESSENTER=`dspmsg smit.cat -s 8 18 "Press Enter to continue."`
        if [ $1 = $yes ]
        then
           /usr/sbin/inulag -A
        else
           echo "$ERROR"
           echo "$PRESSENTER"
           read -r
        RC=-1
        fi
exit $RC
}
x 'yes'


#=--------------------------------------------
# DATE: Oct 14 2022, 00:10:55
# DESCRIPTION: Accept Software Maintenance Terms and Conditions
#=--------------------------------------------

x()
{
yes=`dspmsg smit.cat -s 30 18 "yes"`
        if [ $1 = $yes ]
        then
	   /usr/lib/instl/swma_create -accept
        else
	   /usr/lib/instl/swma_create -decline
        fi
}
x 'yes'


#=--------------------------------------------
# DATE: Oct 14 2022, 00:11:07
# DESCRIPTION: Change Time Zone
#=--------------------------------------------

chtz_proc()
{
if [ "$2" = ',' -a "$3" = ',' ]
then
 chtz "$1"
elif [ "$3" = ',' -a "$4" = ',' ]
then
 chtz "$1$2"
elif [ "$4" = ',' -a "$5" = ',' ]
then
 chtz "$1$2$3"
elif [ "$5" = ',' -a "$6" = ',' ]
then
 chtz "$1$2$3$4"
else
 chtz "$1$2$3$4$5$6$7$8"
fi
exit_chtz="$?"
if [ $exit_chtz = 0 ]
then
echo ' '
echo $(dspmsg smit.cat -s 30 9 'Any changes made to the time zone will take effect
 \\n at the next system boot.')
else
 exit 1
fi
}
chtz_proc 'KORST' '-9'   , ,


#=--------------------------------------------
# DATE: Oct 14 2022, 00:11:09
# DESCRIPTION: 
#=--------------------------------------------

x() { 
passwd root
if [ $? -ne 0 ]
then
        dspmsg -s 52 smit.cat 49 'Press Enter to continue.
'
        read
fi
}
x


#=--------------------------------------------
# DATE: Oct 14 2022, 00:11:13
# DESCRIPTION: Tasks Completed - Exit to Login
#=--------------------------------------------

/usr/lib/assist/exit_assistant


#=--------------------------------------------
# DATE: Oct 14 2022, 14:12:58
# DESCRIPTION: Change / Show Characteristics of a Paging Space
#=--------------------------------------------

chps -s'316' hd6


#=--------------------------------------------
# DATE: Oct 14 2022, 14:20:13
# DESCRIPTION: Minimum Configuration & Startup

To Delete existing configuration data, please use Further Configuration menus
#=--------------------------------------------

/usr/sbin/mktcpip -h'aiximsi' -a'61.81.244.199' -m'255.255.255.0' -i'en0' -g'61.81.244.1' -A'no' -t'N/A'


#=--------------------------------------------
# DATE: Oct 14 2022, 14:20:51
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'openssh_client' -f '/tmp/SM_OP9QTqeg'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OP9QTqeh' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:21:10
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'openssh_server' -f '/tmp/SM_OP5ETqer'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OP5ETqes' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:21:34
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'AllDevicesKernels' -f '/tmp/SM_OPMaTqe3'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OPMaTqe4' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:24:53
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'Alt_Disk_Install' -f '/tmp/SM_OPouTqeF'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OPouTqeG' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:25:06
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'App-Dev' -f '/tmp/SM_OP8qTqeQ'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OP8qTqeR' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:25:49
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'CDE' -f '/tmp/SM_OPGATqe-'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OPGATqfa' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:26:54
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'PerfTools' -f '/tmp/SM_OPaeTqfk'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OPaeTqfl' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:27:17
# DESCRIPTION: Install Software Bundle
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '/dev/cd0' -b 'Server' -f '/tmp/SM_OPuYTqfy'  '-c' '-N' '-g' '-X'  '-G'   '-Y'   '-M'  -k '/tmp/SM_OPuYTqfz' 


#=--------------------------------------------
# DATE: Oct 14 2022, 14:31:22
# DESCRIPTION: Change / Show Characteristics of Operating System
#=--------------------------------------------

chdev -l sys0 -a maxuproc='16384'


#=--------------------------------------------
# DATE: Oct 14 2022, 14:31:34
# DESCRIPTION: Change / Show Characteristics of I/O Completion Ports
#=--------------------------------------------

x() {
chdev -l iocp0 -P $*
if [ $? = 0 ]
then
dspmsg smit.cat -s 25 763 'Changes will become effective at next system restart'
fi
}
x -a autoconfig='available'


#=--------------------------------------------
# DATE: Oct 27 2022, 14:36:10
# DESCRIPTION: Add a Logical Volume
#=--------------------------------------------

/usr/sbin/mklv -y'ptflv' -t'jfs2' rootvg 40


#=--------------------------------------------
# DATE: Oct 27 2022, 14:36:26
# DESCRIPTION: Add an Enhanced Journaled File System
#=--------------------------------------------

x() {
LIST=
FLAG=0
for i in "$@"
do
	case "$i" in
	quota=all)      LIST="$LIST \"quota=userquota,groupquota\"" ;;
	*)	LIST="$LIST \"$i\"" ;;
	esac
done
eval /usr/sbin/crfs -v jfs2 $LIST
}
x -d'ptflv' -m'/ptf' -A'yes' -p'rw' -a agblksize='4096' -a isnapshot='no'


#=--------------------------------------------
# DATE: Oct 27 2022, 14:37:37
# DESCRIPTION: 
#=--------------------------------------------

/usr/sbin/chrctcp -S -a xntpd


#=--------------------------------------------
# DATE: Oct 29 2022, 16:57:24
# DESCRIPTION: Add Additional Language Environments
#=--------------------------------------------

add_lang_environment () {
	## Check for RBAC enabled status. If disabled, check if root
	## else check for authorization aix.system.install
	/usr/sbin/lsattr -El sys0 -a enhanced_RBAC |grep true  > /dev/null
	if [[ $? -ne 0 ]]
		then
			if [[ `whoami` != root ]]
				then
					dspmsg -s 53 smit.cat 75 'Error:  You must be logged in as root to run this command.
' >&2
					exit 1
			fi
	else
		/usr/bin/ckauth aix.system.install
		if [[ $? -ne 0 ]]
		then
			dspmsg -s 53 smit.cat 76 'Error:  You must be logged in as an authorized user to run this command.
' >&2
			exit 1

		fi
	fi
while getopts c:l:d:XMIk:DK: Option "$@"
do
   case $Option in
      c) locale=$OPTARG;;
      l) language=$OPTARG;;
      d) device=$OPTARG;;
      X) extend_fs=-X;;
      M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
      I) INUWPAR_ENABLED="1";;
      k) INUWPAR_FILE=$OPTARG;;
      D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
      K) INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $OPTARG";;
   esac
done

if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi

rm -f /tmp/.patternlist.$$

## Grab just the values inside the brackets
locale=`echo "$locale" | sed 's/][^\[]*\[/ /g' | cut -f2 -d'[' | cut -f1 -d']'`
rm -f /tmp/localelist.$$
touch /tmp/localelist.$$
for loc in $locale
do
   echo $loc >> /tmp/localelist.$$
done
locale=`cat /tmp/localelist.$$ | sort -u`

for i in $locale
do
   /usr/lib/nls/lsmle -c $i -P >> /tmp/.patternlist.$$
   echo 'X11.loc.'${i}'.*' >> /tmp/.patternlist.$$
done

## Grab just the values inside the brackets
language=`echo "$language" | sed 's/][^\[]*\[/ /g' | cut -f2 -d'[' | cut -f1 -d']'`
rm -f /tmp/langlist.$$
touch /tmp/langlist.$$
for lang in $language
do
   echo $lang >> /tmp/langlist.$$
done
language=`cat /tmp/langlist.$$ | cut -f1 -d'.' | sort -u`

for i in $language
do
   echo '.msg.'${i} >> /tmp/.patternlist.$$
done

if [[ -s /tmp/.patternlist.$$ ]]
then
   install_device=$device

   lslpp -Lqc | grep -f /tmp/.patternlist.$$ | cut -f2,3 -d':' > /tmp/.installed_options.$$
   if [[ ! -s /tmp/.installed_options.$$ ]]
   then
      echo '^$' >> /tmp/.installed_options.$$
   fi
   installp -qd $install_device -L | grep -f /tmp/.patternlist.$$ | grep -vf /tmp/.installed_options.$$ | cut -f2,3 -d':' | tr ':' ' ' >> /tmp/install_list.$$
   if [[ -s /tmp/install_list.$$ ]]
   then
      if [[ $INUWPAR_ENABLED == '1' ]]; then 
        inuwpar ${INUWPAR:+$INUWPAR} installp -qQacNg $extend_fs -d $install_device -f /tmp/install_list.$$
      else
        installp -qQacNg $extend_fs -d $install_device -f /tmp/install_list.$$
      fi
      RC=$?
   else
      dspmsg -s 53 smit.cat 71 'Error:  The selected CULTURAL convention and LANGUAGE translation
        require the installation of filesets which could not be found
        in the current input device or directory.

' >&2
      rm -f /tmp/.patternlist.$$ /tmp/.installed_options.$$ /tmp/.install_list.$$
      exit 1
   fi

fi
rm -f /tmp/.patternlist.$$ /tmp/.installed_options.$$ /tmp/.install_list.$$ /tmp/install_list.$$ /tmp/langlist.$$  /tmp/localelist.$$
exit $RC

}
add_lang_environment -c 'UTF-8      Korean [KO_KR] IBM-eucKR  Korean [ko_KR]' -l '' -d '/dev/cd0' '-X' '-M'  -k '/tmp/SM_OPHqU7ee' 


#=--------------------------------------------
# DATE: Oct 29 2022, 17:09:35
# DESCRIPTION: Add Additional Language Environments
#=--------------------------------------------

add_lang_environment () {
	## Check for RBAC enabled status. If disabled, check if root
	## else check for authorization aix.system.install
	/usr/sbin/lsattr -El sys0 -a enhanced_RBAC |grep true  > /dev/null
	if [[ $? -ne 0 ]]
		then
			if [[ `whoami` != root ]]
				then
					dspmsg -s 53 smit.cat 75 'Error:  You must be logged in as root to run this command.
' >&2
					exit 1
			fi
	else
		/usr/bin/ckauth aix.system.install
		if [[ $? -ne 0 ]]
		then
			dspmsg -s 53 smit.cat 76 'Error:  You must be logged in as an authorized user to run this command.
' >&2
			exit 1

		fi
	fi
while getopts c:l:d:XMIk:DK: Option "$@"
do
   case $Option in
      c) locale=$OPTARG;;
      l) language=$OPTARG;;
      d) device=$OPTARG;;
      X) extend_fs=-X;;
      M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
      I) INUWPAR_ENABLED="1";;
      k) INUWPAR_FILE=$OPTARG;;
      D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
      K) INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $OPTARG";;
   esac
done

if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi

rm -f /tmp/.patternlist.$$

## Grab just the values inside the brackets
locale=`echo "$locale" | sed 's/][^\[]*\[/ /g' | cut -f2 -d'[' | cut -f1 -d']'`
rm -f /tmp/localelist.$$
touch /tmp/localelist.$$
for loc in $locale
do
   echo $loc >> /tmp/localelist.$$
done
locale=`cat /tmp/localelist.$$ | sort -u`

for i in $locale
do
   /usr/lib/nls/lsmle -c $i -P >> /tmp/.patternlist.$$
   echo 'X11.loc.'${i}'.*' >> /tmp/.patternlist.$$
done

## Grab just the values inside the brackets
language=`echo "$language" | sed 's/][^\[]*\[/ /g' | cut -f2 -d'[' | cut -f1 -d']'`
rm -f /tmp/langlist.$$
touch /tmp/langlist.$$
for lang in $language
do
   echo $lang >> /tmp/langlist.$$
done
language=`cat /tmp/langlist.$$ | cut -f1 -d'.' | sort -u`

for i in $language
do
   echo '.msg.'${i} >> /tmp/.patternlist.$$
done

if [[ -s /tmp/.patternlist.$$ ]]
then
   install_device=$device

   lslpp -Lqc | grep -f /tmp/.patternlist.$$ | cut -f2,3 -d':' > /tmp/.installed_options.$$
   if [[ ! -s /tmp/.installed_options.$$ ]]
   then
      echo '^$' >> /tmp/.installed_options.$$
   fi
   installp -qd $install_device -L | grep -f /tmp/.patternlist.$$ | grep -vf /tmp/.installed_options.$$ | cut -f2,3 -d':' | tr ':' ' ' >> /tmp/install_list.$$
   if [[ -s /tmp/install_list.$$ ]]
   then
      if [[ $INUWPAR_ENABLED == '1' ]]; then 
        inuwpar ${INUWPAR:+$INUWPAR} installp -qQacNg $extend_fs -d $install_device -f /tmp/install_list.$$
      else
        installp -qQacNg $extend_fs -d $install_device -f /tmp/install_list.$$
      fi
      RC=$?
   else
      dspmsg -s 53 smit.cat 71 'Error:  The selected CULTURAL convention and LANGUAGE translation
        require the installation of filesets which could not be found
        in the current input device or directory.

' >&2
      rm -f /tmp/.patternlist.$$ /tmp/.installed_options.$$ /tmp/.install_list.$$
      exit 1
   fi

fi
rm -f /tmp/.patternlist.$$ /tmp/.installed_options.$$ /tmp/.install_list.$$ /tmp/install_list.$$ /tmp/langlist.$$  /tmp/localelist.$$
exit $RC

}
add_lang_environment -c 'UTF-8      English (United States) [EN_US] UTF-8      German [DE_DE] ISO8859-15 German [de_DE.8859-15] ISO8859-1  German [de_DE] IBM-1252   German [de_DE.IBM-1252]' -l '' -d '/dev/cd0' '-X' '-M'  -k '/tmp/SM_OP-EU7ee' 


#=--------------------------------------------
# DATE: Dec 17 2022, 14:45:32
# DESCRIPTION: Add a Scalable Volume Group
#=--------------------------------------------

x(){
ARGS=''
ARGS=`echo $* | sed 's/-sDEFAULT//g'`
/usr/sbin/mkvg -S $ARGS
}
x -y'datavg' -s'512' '-n' -V'51' '-C' hdisk2 hdisk3 hdisk4 hdisk5 hdisk6 hdisk7 hdisk8


#=--------------------------------------------
# DATE: Dec 17 2022, 14:47:50
# DESCRIPTION: Rename a Logical Volume
#=--------------------------------------------

/usr/sbin/chlv -n'epprdaloglv' epprdalog


#=--------------------------------------------
# DATE: Dec 17 2022, 17:51:54
# DESCRIPTION: Add a Group
#=--------------------------------------------

mkgroup -'A' id='202' sapinst


#=--------------------------------------------
# DATE: Dec 17 2022, 17:52:11
# DESCRIPTION: Add a Group
#=--------------------------------------------

mkgroup -'A' id='203' sapsys


#=--------------------------------------------
# DATE: Dec 17 2022, 17:52:40
# DESCRIPTION: Add a Group
#=--------------------------------------------

mkgroup -'A' id='204' dba


#=--------------------------------------------
# DATE: Dec 17 2022, 17:52:53
# DESCRIPTION: Add a Group
#=--------------------------------------------

mkgroup -'A' id='205' oper


#=--------------------------------------------
# DATE: Dec 17 2022, 17:54:21
# DESCRIPTION: Change / Show Characteristics of a User
#=--------------------------------------------

x() {
if [ $# -ge 2 ] 
then
	for i in "$@" 
	do
		spam="$spam \"$i\""
	done
	eval chuser $spam
fi
}
x id='301' sshd


#=--------------------------------------------
# DATE: Dec 17 2022, 17:58:43
# DESCRIPTION: Change / Show Characteristics of a User
#=--------------------------------------------

x() {
if [ $# -ge 2 ] 
then
	for i in "$@" 
	do
		spam="$spam \"$i\""
	done
	eval chuser $spam
fi
}
x id='300' smmsp


#=--------------------------------------------
# DATE: Dec 17 2022, 18:06:11
# DESCRIPTION: Configure Defined I/O Completion Ports
#=--------------------------------------------

mkdev -l iocp0


#=--------------------------------------------
# DATE: Dec 17 2022, 18:06:14
# DESCRIPTION: Change / Show Characteristics of I/O Completion Ports
#=--------------------------------------------

x() {
chdev -l iocp0 -P $*
if [ $? = 0 ]
then
dspmsg smit.cat -s 25 763 'Changes will become effective at next system restart'
fi
}
x -a autoconfig='available'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:26:08
# DESCRIPTION: Minimum Configuration & Startup

To Delete existing configuration data, please use Further Configuration menus
#=--------------------------------------------

/usr/sbin/mktcpip -h'epprda' -a'61.81.244.134' -m'255.255.255.0' -i'en0' -g'61.81.244.1' -A'no' -t'N/A'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:28:56
# DESCRIPTION: Add a File System for Mounting
#=--------------------------------------------

/usr/sbin/mknfsmnt -f '/sapcd' -d '/sapcd' -h 'epdev' -M 'sys' '-B' '-A' -t 'rw' -w 'bg' '-Y' '-Z' '-X' '-S' '-j' '-q' '-g'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:30:06
# DESCRIPTION: Add a File System for Mounting
#=--------------------------------------------

/usr/sbin/mknfsmnt -f '/usr/sap/trans' -d '/usr/sap/trans' -h 'epdev' -M 'sys' '-B' '-A' -t 'rw' -w 'bg' '-Y' '-Z' '-X' '-S' '-j' '-q' '-g'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:31:50
# DESCRIPTION: Add a File System for Mounting
#=--------------------------------------------

/usr/sbin/mknfsmnt -f '/board' -d '/board_org' -h 'epprd' -M 'sys' '-B' '-A' -t 'rw' -w 'bg' '-Y' '-Z' '-X' '-S' '-j' '-q' '-g'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:35:38
# DESCRIPTION: Minimum Configuration & Startup

To Delete existing configuration data, please use Further Configuration menus
#=--------------------------------------------

/usr/sbin/mktcpip -h'epprda' -a'61.81.244.218' -m'255.255.255.0' -i'en0' -g'61.81.244.1' -A'no' -t'N/A'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:37:44
# DESCRIPTION: Install Software
#=--------------------------------------------

preprocess_inuwpar()
{
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) INUWPAR=${INUWPAR:+"$INUWPAR "}"-G";;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; INUWPAR=${INUWPAR:+"$INUWPAR "}"-d $1";;
     -k) shift; INUWPAR_FILE=$1;;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    eval /usr/sbin/inuwpar $INUWPAR /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
else
    eval /usr/lib/instl/sm_inst installp_cmd -a -Q ${ARGS:+$ARGS}
fi
}
preprocess_inuwpar -d '.' -f '/tmp/SM_OPgRiMef'  '-c' '-N' '-g' '-X'   '-G'   '-Y'   '-M'  -k '/tmp/SM_OPgRiMeg' 


#=--------------------------------------------
# DATE: Jan 28 2023, 16:39:21
# DESCRIPTION: Update Installed Software to Latest Level (Update All)
#=--------------------------------------------

preprocess_inuwpar()
{
RC=0
CRC=0
WRC=0
GRC=0
WDEV=
GINST=
while [[ -n $1 ]]; do
   typeset OPTION=$1
   case $OPTION in
     -D) INUWPAR=${INUWPAR:+"$INUWPAR "}"-D";;
     -M) GINST=1;;
     -I) INUWPAR_ENABLED="1";;
     -K) shift; WDEV="-d $1 ";;
     -k) shift; INUWPAR_FILE=$1;;
     -d) shift; IDEV="-d $1 ";;
     -p) INUWPAR=${INUWPAR:+"$INUWPAR "}"-p"
      ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
     -X) INUWPAR=${INUWPAR:+"$INUWPAR "}"-X"
      ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
     -V2) INUWPAR=${INUWPAR:+"$INUWPAR "}"-v"
      ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
     *) ARGS=${ARGS:+"$ARGS "}"'$OPTION'";;
   esac
   shift
done
if [[ -n $WDEV ]]; then
   SDEV=${WDEV}
else
   SDEV=${IDEV}
fi
if [[ -n $INUWPAR_FILE ]]; then
  if [[ `head -1 $INUWPAR_FILE` == '_all_wpars' ]]; then
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-A"
  else
    awk '{gsub(/ /,"\n");print}' < $INUWPAR_FILE > /tmp/inuwpar.$$.list
    mv /tmp/inuwpar.$$.list $INUWPAR_FILE
    INUWPAR=${INUWPAR:+"$INUWPAR "}"-f $INUWPAR_FILE"
  fi
fi
if [[ -n $INUWPAR_ENABLED ]]; then
    if [[ -n $GINST ]]; then
       eval /usr/lib/instl/sm_inst installp_cmd -a ${IDEV} ${ARGS:+$ARGS}
       GRC=$?
    fi
    /usr/sbin/syncwpar -D $SDEV $INUWPAR
    WRC=$?
else
    eval /usr/lib/instl/sm_inst installp_cmd -a ${IDEV} ${ARGS:+$ARGS}
    GRC=$?
fi
if [ $GRC -ne 0 -o $WRC -ne 0 ]
then
   RC=1
fi
exit $RC
}
preprocess_inuwpar -d '.' -f '/tmp/SM_OP0NiMef'  '-c' '-N' '-g' '-X'    '-Y'  '-M'  -k '/tmp/SM_OP0NiMeg' 


#=--------------------------------------------
# DATE: Jan 28 2023, 16:40:54
# DESCRIPTION: Minimum Configuration & Startup

To Delete existing configuration data, please use Further Configuration menus
#=--------------------------------------------

/usr/sbin/mktcpip -h'epprda' -a'61.81.244.134' -m'255.255.255.0' -i'en0' -g'61.81.244.1' -A'no' -t'N/A'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:54:34
# DESCRIPTION: Setup a Cluster, Nodes and Networks
#=--------------------------------------------

main() {
	    cluster_name=$1
	    node_list="$2"
        /usr/es/sbin/cluster/utilities/clodmget -f name,multi_site_lc -n HACMPcluster | IFS=: read cname ctype
        if [[ -z $cname ]]
        then
            #
            # There is no cluster configured - the cmd_to_discover
            # below cooked up the local node name as one of the nodes
            # to add, here we tack the same onto the node list
            #
			localnode=$(hostname)
			node_list="$localnode $node_list"
	        /usr/es/sbin/cluster/utilities/clmgr add cluster $cluster_name NODES="$node_list" 
        else
            # There is a cluster configured - to invoke the "modify"
            # commands we need to figure out what has changed
            name_arg=""
            [[ $cluster_name != $cname ]] && name_arg="NAME=$cluster_name"
            nodes_arg=""
            [[ $(echo $node_list | sort -u) != $(/usr/es/sbin/cluster/utilities/cllsclstr -cwng | tail -1 | cut -f5 -d: | sort -u) ]] && nodes_arg="NODES=$node_list"
            [[ -n "$cname_arg$nodes_arg$type_arg" ]] && /usr/es/sbin/cluster/utilities/clmgr modify cluster $name_arg $nodes_arg 
	    fi
	}
	main 'epprda_cluster' 'epprds.sebang.com'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:55:02
# DESCRIPTION: PowerHA SystemMirror Configuration
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/cltopinfo


#=--------------------------------------------
# DATE: Jan 28 2023, 16:55:16
# DESCRIPTION: Add a Repository Disk
#=--------------------------------------------


function main {
    PATH=$PATH:/usr/es/sbin/cluster/utilities
    typeset repositories=$(echo "$*" | sed 's/[()]//g')
    clmgr add repository $repositories DISABLE_VALIDATION=true
}
main '(00c44af11e9e1645)'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:55:40
# DESCRIPTION: Add a Service IP Label/Address
#=--------------------------------------------

cmd_to_exec() {
    typeset IP=$1
    typeset MASK="" NW=""
    if [[ $2 == *NETWORK=* ]]; then
        NW=${2#*=}  # No NETMASK/PREFIX was specified
    else
        MASK=${2#*=}
        NW=${3#*=}
    fi

    typeset HAUTILS="/usr/es/sbin/cluster/utilities"
    if [[ -n $MASK ]]; then
        typeset AF=$($HAUTILS/cllsif -J \| -Sn $IP 2>/dev/null | cut -d\| -f 15)
        if [[ -z $AF || $AF != AF_INET* ]]; then
            typeset NAME="" IS="" ADDR="" REM=""
            /usr/bin/host $IP | read NAME IS ADDR REM
            AF="AF_INET6"
            if [[ $NAME == +([0-9])\.+([0-9])\.+([0-9])\.+([0-9]) ||
                  $ADDR == +([0-9])\.+([0-9])\.+([0-9])\.+([0-9]) ]]
            then
                AF="AF_INET"
            fi
        fi
        typeset MASK_TYPE="NETMASK"                    # For IPv4
        [[ $AF == "AF_INET6" ]] && MASK_TYPE="PREFIX"  # For IPv6
        $HAUTILS/clmgr add service_ip $IP $MASK_TYPE=$MASK NETWORK=$NW
    else
        $HAUTILS/clmgr add service_ip $IP NETWORK=$NW
    fi
    return $?
}
cmd_to_exec 'epprd.sebang.com' NETMASK='255.255.255.0' NETWORK='net_ether_01'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:56:44
# DESCRIPTION: Add Application Controller Scripts
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/claddserv -s'epprd_app' -b'/etc/hacmp/epprd_start.sh' -e'/etc/hacmp/epprd_stop.sh'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:56:58
# DESCRIPTION: Add a Resource Group
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/claddgrp  -g 'epprd_rg' -n 'epprda epprds' -S 'OHN' -O 'FNPN' -B 'NFB'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:58:44
# DESCRIPTION: Change/Show All Resources and Attributes for a Resource Group
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr modify resource_group  'epprd_rg' SERVICE_LABEL='epprd' APPLICATIONS='epprd_app' VOLUME_GROUP='datavg' EXPORT_FILESYSTEM='/board_org' MOUNT_FILESYSTEM='/board;/board_org'


#=--------------------------------------------
# DATE: Jan 28 2023, 16:59:47
# DESCRIPTION: Verify and Synchronize Cluster Configuration
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr sync cluster FIX=Interactive


#=--------------------------------------------
# DATE: Jan 28 2023, 17:07:50
# DESCRIPTION: Change/Show a Node
#=--------------------------------------------

cmd_to_exec() {
           NODE=${1}
           NEWNODE=${2#-n}
           COMM_PATH=${3#-p}
           ENABLE_LIVEUPDATE=${4#-l}
           if [[ -n $NEWNODE ]]; then 
             NEWNODE="NEWNAME=$NEWNODE"
           fi
           if [[ -n $COMM_PATH ]]; then 
             COMM_PATH="COMMPATH=$COMM_PATH"
           fi
           if [[ -n $ENABLE_LIVEUPDATE ]]; then 
             ENABLE_LIVEUPDATE="ENABLE_LIVE_UPDATE=$ENABLE_LIVEUPDATE"
           fi
           /usr/es/sbin/cluster/utilities/clmgr modify node $NODE $NEWNODE $COMM_PATH $ENABLE_LIVEUPDATE
        }
        cmd_to_exec 'epprds' -n'' -p'epprds' -l'true'


#=--------------------------------------------
# DATE: Jan 28 2023, 17:08:05
# DESCRIPTION: Verify and Synchronize Cluster Configuration
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr sync cluster FIX=Interactive


#=--------------------------------------------
# DATE: Jan 28 2023, 17:10:01
# DESCRIPTION: Start Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_rc.cluster '-N' -cspoc-n 'epprda,epprds' '-A'    '-C interactive'


#=--------------------------------------------
# DATE: Jan 28 2023, 17:57:18
# DESCRIPTION: Add a Directory to Exports List
#=--------------------------------------------

/usr/sbin/mknfsexp -d '/sapmnt/EPP' '-I' -f '/usr/es/sbin/cluster/etc/exports' -S 'sys,krb5p,krb5i,krb5,dh' -t 'rw' -c 'epprdap' -r 'epprdap'


#=--------------------------------------------
# DATE: Jan 28 2023, 17:59:34
# DESCRIPTION: Change/Show All Resources and Attributes for a Resource Group
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr modify resource_group  'epprd_rg' EXPORT_FILESYSTEM='/board_org;/sapmnt/EPP'


#=--------------------------------------------
# DATE: Jan 28 2023, 17:59:41
# DESCRIPTION: Change/Show All Resources and Attributes for a Resource Group
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr modify resource_group  'epprd_rg' EXPORT_FILESYSTEM='/board_org /sapmnt/EPP'


#=--------------------------------------------
# DATE: Jan 28 2023, 17:59:56
# DESCRIPTION: Stop Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_clstop '-N' -cspoc-n 'epprda,epprds'  '-g'


#=--------------------------------------------
# DATE: Jan 28 2023, 18:01:30
# DESCRIPTION: Verify and Synchronize Cluster Configuration
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clmgr sync cluster FIX=Interactive


#=--------------------------------------------
# DATE: Jan 28 2023, 18:03:07
# DESCRIPTION: Start Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_rc.cluster '-N' -cspoc-n 'epprda,epprds' '-A'    '-C interactive'


#=--------------------------------------------
# DATE: Jan 28 2023, 18:05:18
# DESCRIPTION: Stop Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_clstop '-N' -cspoc-n 'epprda,epprds'  '-g'


#=--------------------------------------------
# DATE: Jan 28 2023, 18:06:21
# DESCRIPTION: Start Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_rc.cluster '-N' -cspoc-n 'epprda,epprds' '-A'    '-C interactive'


#=--------------------------------------------
# DATE: Jan 28 2023, 18:16:51
# DESCRIPTION: Remove an NFS File System
#=--------------------------------------------

/usr/sbin/rmnfsmnt -f '/board' '-B'


#=--------------------------------------------
# DATE: Jan 28 2023, 19:41:10
# DESCRIPTION: Move Resource Group(s) to Another Node
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clRGmove -s 'false'  -m -i -g 'epprd_rg' -n 'epprds'


#=--------------------------------------------
# DATE: Jan 28 2023, 19:49:03
# DESCRIPTION: Move Resource Group(s) to Another Node
#=--------------------------------------------

/usr/es/sbin/cluster/utilities/clRGmove -s 'false'  -m -i -g 'epprd_rg' -n 'epprda'


#=--------------------------------------------
# DATE: Sep 28 2023, 15:55:36
# DESCRIPTION: Stop Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_clstop '-N' -cspoc-n 'epprda,epprds'  '-g'


#=--------------------------------------------
# DATE: Sep 30 2023, 03:24:42
# DESCRIPTION: Start Cluster Services
#=--------------------------------------------

_SPOC_FORCE=Y /usr/es/sbin/cluster/cspoc/fix_args nop cl_rc.cluster '-N' -cspoc-n 'epprda,epprds' '-A'    '-C interactive'


#=--------------------------------------------
# DATE: Dec 04 2024, 14:44:07
# DESCRIPTION: Add a Scalable Volume Group
#=--------------------------------------------

x(){
ARGS=''
ARGS=`echo $* | sed 's/-sDEFAULT//g'`
/usr/sbin/mkvg -S $ARGS
}
x -y'isovg' -s'1024' hdisk11


#=--------------------------------------------
# DATE: Dec 04 2024, 14:49:41
# DESCRIPTION: Add an Enhanced Journaled File System
#=--------------------------------------------

x() {
LIST=
FLAG=0
for i in "$@"
do
	case "$i" in
	Megabytes)	FLAG=1;;
	Gigabytes)	FLAG=2;;
	512bytes)	;;
	quota=all)      LIST="$LIST \"quota=userquota,groupquota\"" ;;
	size=*)	case "$FLAG" in
		1)	LIST="$LIST \"$i\"M"
			FLAG=0;;
		2)	LIST="$LIST \"$i\"G"
			FLAG=0;;
		0)	LIST="$LIST \"$i\""
			;;
		esac
		;;
	*)	LIST="$LIST \"$i\""
		;;
	esac
done
eval /usr/sbin/crfs -v jfs2 $LIST
}
x -g'isovg' 'Gigabytes' -a size='98' -m'/iso' -A'yes' -p'rw' -a agblksize='4096' -a isnapshot='no'


#=--------------------------------------------
# DATE: Apr 16 2025, 11:27:59
# DESCRIPTION: Remove a Volume Group
#=--------------------------------------------

/usr/sbin/reducevg -df isovg hdisk11
