#!/bin/sh
################################################################################
#
#                     S H E L L   S C R I P T  F I L E
# 
#                      COPYRIGHT (c) 2000 - 2016 MOTOROLA
#                         All Rights Reserved
#                    MOTOROLA CONFIDENTIAL PROPRIETARY
#
################################################################################
#
#   FILE NAME       : install
#   FUNCTION        : OMC System Installation Script
#   PARAMETERS      : "h" "."
#
#   List of functions in their order in this script:
#
#           change_to_root
#           initialize_variables
#           uninstall_linux_packages
#           disable_selinux
#           configure_java_package
#           stop_services
#           restart_services
#           resize_disk_volume
#           configure_ethernet_if
#           allow_su
#           add_serial_console_login
#           update_ntp_configuration_file
#           setup_system
#           remove_passwd_expiration
#           stop_masteragent
#           validate_java_applications_not_running
#           create_symbolic_links_for_masteragent
#           remove_symbolic_links_for_masteragent
#           install_cleanup
#           show_welcome
#           choose_install_directory
#           conf_shared_libs_cache
#           install_mysql
#           install_omc
#           print_starting_banner
#           print_completion_banner
#           change_to_install_directory
#           post_install_message
#           prompt_select_rng
#           do_exit
#           stop_security_monitor
#           update_security_monitor
#           start_installation
#           install_preparation
#           print_in_console_and_syslog
#           install_system
#           full_options_install
#           reduced_options_installl
#           has_the_pdr_version_changed
#           determine_install   
#             
################################################################################
#
################################################################################
#
# Revision History:
#
# Date        Name          Prob#      Description
# ----------  -----------  ----------  -----------------------------------------
# 08/02/2011  bmr014                  Initial version form PDG install
################################################################################

##### . `dirname $0`/bin/common_mot_functions

OS_TYPE=`uname -s`
SAVENAME="$LOGNAME"


function change_to_root
{
    if [[ $LOGNAME != root ]]
    then

       case "$OS_TYPE" in
          Linux)
             export LOGNAME=root
             su root -c "$0 $*"
             export LOGNAME="$SAVENAME"
             ;;
          *)
             su root -c "$0 $*"
             ;;
       esac

       exit $SUCCESS
    fi

}
  

function initialize_variables
{
  #
  # Initialize Variables.
  #
  SUCCESS=0
  FAILURE=1
  TRUE=1
  FALSE=0
  
  get_platform_type
  cur_pwd=`pwd`
  
  lib_dir=$bin_dir
  
  # export LD_LIBRARY_PATH=$(bin_dir)
  
  dummy=/tmp/dummy

  Wng_exist=1
  system_option=1
  # httpd_conf=/etc/httpd/conf/httpd.conf
  ntp_conf=/etc/ntp.conf

     install_source="nofile"
    if			[ -e /media/cdrom/upgrade_omc ] 
    then								# OMC iso
			install_source="/media/cdrom"
    else
		if 		[ -e /media/cdrecorder/upgrade_omc ]
		then								# OMC iso
				install_source="/media/cdrecorder"
		fi
    fi

     cgi_bin_dir=/var/www/cgi-bin
     html_dir=/var/www/html
     snmpd_conf=/usr/share/snmp/snmpd.conf
     eth0_if_cfg=/etc/sysconfig/network-scripts/ifcfg-eth0
     #Store the PDR IP address configured on eth0
     my_ip=$(ifconfig eth0 | grep inet | awk '{print $2}' | awk '{print substr($$0,6,16)}')
  
  ver_change_result=$FALSE
  
     
  #
  # Export DATA_APP_BIN_DIR so control_daemon can be found
  #
  export DATA_APP_BIN_DIR=${bin_dir}
}

function get_platform_type
{
   platform_type=`uname -m`
}
 
#
# Remove some of the packages installed by the Linux installer.
#

function uninstall_linux_packages
{
    ret=
}

function stop_services
{
   #
   # Stop services that use the partitions that we want to extend
   #

   if [ -x /etc/init.d/httpd ]
   then
      /sbin/service httpd stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/syslog-ng ]
   then
      /sbin/service syslog-ng stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/auditd ]
   then
      /sbin/service auditd stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/smb ]
   then
      /sbin/service smb stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/winbind ]
   then
      /sbin/service winbind stop > /dev/null 2>&1
   fi   
   if [ -x /etc/init.d/messagebus ]
   then
      /sbin/service messagebus stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/crond ]
   then
      /sbin/service crond stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/pcscd ]
   then
      /sbin/service pcscd stop > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/rhsmcertd ]
   then
	  /sbin/service rhsmcertd stop > /dev/null 2>&1
   fi
}

function restart_services
{
   if [ -x /etc/init.d/httpd ]
   then
      /sbin/service httpd restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/syslog-ng ]
   then
      /sbin/service syslog-ng restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/auditd ]
   then
      /sbin/service auditd restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/smb ]
   then
      /sbin/service smb restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/winbind ]
   then
      /sbin/service winbind restart > /dev/null 2>&1
   fi   
   if [ -x /etc/init.d/messagebus ]
   then
      /sbin/service messagebus restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/crond ]
   then
      /sbin/service crond restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/pcscd ]
   then
      /sbin/service pcscd restart > /dev/null 2>&1
   fi
   if [ -x /etc/init.d/rhsmcertd ]
   then
      /sbin/service rhsmcertd restart > /dev/null 2>&1
   fi
}

function resize_partition
{
    logical_volume_name=/dev/Active_Update/$1
    mount_point=$2
    new_size=$3
    ret=
 
	echo "resize_partition:: logical_volume_name=" ${logical_volume_name}  "mount_point=" ${mount_point} "new_size=" $new_size

    # Firs test with lvextend
    lvm lvextend -L${new_size} -t  ${logical_volume_name} > /dev/null 2>&1 
    case $? in
        "0")
            if umount ${mount_point}
            then
                lvm lvextend -L$new_size ${logical_volume_name}
                e2fsck -f ${logical_volume_name}
                resize2fs ${logical_volume_name}
                e2fsck -f ${logical_volume_name}
                mount ${mount_point}
                ret=$SUCCESS
            else
                print_in_console_and_syslog "FAILURE: unable to unmount ${mount_point}!"
                ret=$FAILURE
            fi
            ;;
        "3")
            echo "No need to resize ${mount_point} partition" 
            ret=$SUCCESS
            ;;
        "5")
            print_in_console_and_syslog "FAILURE: Insufficient free space for ${mount_point}"
            ret=$FAILURE
            ;;
        *)
            ret=$FAILURE
            ;;
    esac
    return $ret
}



function create_new_logical_partition
{
    logical_volume_name=/dev/Active_Update/$1
    mount_point=$2
    new_size=$3
    ret=
 
	echo "create_new_logical_partition:: logical_volume_name=" ${logical_volume_name}  "mount_point=" ${mount_point} "new_size=" $new_size

    # Firs create new logical partition
	lvcreate -l ${new_size} -n  $1 Active_Update 
	
	# Create file system on the new logical partition
	mke2fs -j ${logical_volume_name}
	
	mkdir ${mount_point}
	
	# mount the new logical partition
	mount ${logical_volume_name} ${mount_point}
	
	mkdir -p ${mount_point}/mysql	
	sleep 1
	
	# add new logical partition to fstab 
	echo  ${logical_volume_name}  ${mount_point}  ext3  defaults  1  2 >> /etc/fstab
	
	# mkdir -p /var/lib/mysql
	cd /var/lib/
	
	ln -sf ${mount_point}/mysql mysql 

}


function umount_var_deps
{
    ret=

    if umount /var/log
    then
       
        if umount /var/viewlogs
        then

            if umount /var/getlogs
            then
                ret=$SUCCESS
            else
                print_in_console_and_syslog "FAILURE: unable to unmount $/var/getlogs!"
                mount /var/viewlogs
                mount /var/log
                ret=$FAILURE
            fi

        else
            print_in_console_and_syslog "FAILURE: unable to unmount $/var/viewlogs!"
            mount /var/log
            ret=$FAILURE
        fi

    else               
        print_in_console_and_syslog "FAILURE: unable to unmount $/var/viewlogs!"
        ret=$FAILURE
    fi

    return $ret
}

function mount_var_deps
{
    mount /var/getlogs
    mount /var/viewlogs
    mount /var/log
}

function resize_disk_volume
{
    var_log_size="7.5G"
    opt_size="10G"
    var_size="65G"

    # resize log parititon (home of /var/log)
    stop_services
    resize_partition "log" "/var/log" ${var_log_size}
    if [ $? != $SUCCESS ]
    then
        print_in_console_and_syslog "FAILURE: unable to resize /var/log partition!"
        restart_services
        install_cleanup
        exit $FAILURE
    fi
	
	
	# resize opt parititon
    service snmpd stop > /dev/null 2>&1
    resize_partition "opt" "/opt" ${opt_size}
    if [ $? != $SUCCESS ]
    then
        print_in_console_and_syslog "FAILURE: unable to resize /opt partition!"
        service snmpd start > /dev/null 2>&1
        install_cleanup
        exit $FAILURE
    else
        service snmpd start > /dev/null 2>&1
    fi
	

    # resize var parititon (we need same services + few more to be stopped when resizing /var)
    # In order to resize /var, we need to umoung /var/log, /var/viewlogs and /var/getlogs 

	free_lvm=$(pvdisplay | grep "Free PE" | awk '{print $3}')
	
	print_in_console_and_syslog "free_lvm = $free_lvm"
	
	if [[ "$free_lvm" -eq 0 ]] 
	then 
		print_in_console_and_syslog "No disk space free to extend."
		return $FAILURE
	fi

    create_new_logical_partition "sql" "/sql" ${free_lvm}
	
    restart_services

}


function configure_ethernet_if
{
   printf "$(date) .... Configuring ethernet interface ....\n"
   /etc/sysconfig/network-scripts/ifdown eth0

   #
   # Add options
   #
   grep -v ETHTOOL_OPTS ${eth0_if_cfg}                      > ${eth0_if_cfg}$$
   if [[ $platform_type != "i686" ]]
   then
      echo ETHTOOL_OPTS\=\"speed 10 duplex half autoneg off\" >> ${eth0_if_cfg}$$
   else
      echo ETHTOOL_OPTS\=\"speed 100 duplex full autoneg off\" >> ${eth0_if_cfg}$$
   fi
   cp ${eth0_if_cfg}$$ ${eth0_if_cfg}
   rm -f ${eth0_if_cfg}$$

   #
   # Restart interface to use options.
   #
   /etc/sysconfig/network-scripts/ifup eth0

   printf "$(date) .... Configuring ethernet interface .... Done\n"
}

function allow_su
{
   cp -a /etc/pam.d/su /etc/pam.d/su.org
   # comment out the line that requires the user that does 'su' to be in the wheel group
   sed 's/auth required    \/lib\/security\/$ISA\/pam_wheel\.so use_uid/\#auth required    \/lib\/security\/$ISA\/pam_wheel\.so use_uid/' /etc/pam.d/su.org > /etc/pam.d/su
}

function add_serial_console_login
{
   result=`grep -c S0:2345 /etc/inittab`
   if [ $result != 0 ] 
   then
      printf "$(date) .... Serial port already enabled in inittab ....\n"
   else
      printf "$(date) .... Serial port not enabled in inittab, now enabling it ....\n"
      echo ""                                                 >> /etc/inittab
      echo "# Run agetty on COM1/ttyS0"                       >> /etc/inittab
      echo "S0:2345:respawn:/sbin/agetty -L 9600 ttyS0 vt100" >> /etc/inittab

      # make init re-read the inittab file
      /sbin/init q
   fi

   # and enable root to do remote login there as well
   result=`grep -c ttyS0 /etc/securetty`
   if [ $result == 0 ]
   then
      echo ttyS0 >> /etc/securetty
   fi
}

function update_ntp_configuration_file
{
   #
   # Update the ntp config file simply by overwriting the file installed
   # during OS installation, with the pdr specific config file. 
   #
   printf "$(date) .... Updating ntp configuration ....\n"
   
   cp $install_source/bin/ntp.conf $ntp_conf
   chmod 644 $ntp_conf

   #
   # Disable authentication (-A) and step time at ntpd restart (-x)
   #
   echo "OPTIONS=\"-A -x -u ntp:ntp -p /var/run/ntpd.pid\"" > /etc/sysconfig/ntpd      
}

function setup_system
{ 
   #
   # Update httpd.conf file
   #
   #  /opt/Motorola/clc/scripts/app/pdr_httpd_hardening
   
   #
   # Prompt the user whether to enable core dumps
   #
   # done="false"
   
   # until [[ "$done" = "true" ]]; do
    #  printf "$(date) .... Should the installation enable core dumps? [y/n] : "
    #  read answer
    #
    #  if [[ "$answer" = "y" ]]; then
   #      $clc_sbin_dir/pdr_switch_core_dump on 0
   #      if [[ "$?" = "$SUCCESS" ]]; then
   #         done="true"
   #      fi
   #
   #     elif [[ "$answer" = "n" ]]; then
   #       $clc_sbin_dir/pdr_switch_core_dump off 0
   #      if [[ "$?" = "$SUCCESS" ]]; then
   #         done="true"
   #      fi

   #   else
   #      printf "$(date) .... Invalid entry.  Please try again\n"
   #   fi
#   done
   
      resize_disk_volume
      uninstall_linux_packages
      allow_su
      # add_serial_console_login
      # update_ntp_configuration_file

      # Do not configure ethernet options for installation on vmware
      #if [[ $(lspci | grep -ic vmware) -eq 0 ]]
      #then
      #  configure_ethernet_if
      #fi

   service httpd restart > /dev/null 2>&1
}



function install_cleanup
{
   save_dir=`pwd`

   #
   # function install_cleanup cleans upon installation failure
   #
   printf "$(date) .... Installation FAILED! ....\n"
   printf "$(date) .... Retrieving old bin directory ....\n"
   printf "$(date) .... Exiting install script ....\n"

   # rm -rf $bin_dir
   # if [ -d $bak_bin_dir ]
   # then
      # mv $bak_bin_dir $bin_dir
   # fi

   # rm -rf $cgi_bin_dir

   # if [ -d $bak_cgi_bin_dir ]
   # then
      # mv $bak_cgi_bin_dir $cgi_bin_dir
   # fi

   # rm -rf $html_dir
   # if [ -d $bak_html_dir ]
   # then
      # mv $bak_html_dir $html_dir
   # fi

   cd $save_dir
}


function show_welcome
{
   #
   # Display a welcome text.
   #
cat <<!

   ##############################################################
   #                   OMC Upgrade Script                       #
   #           Copyright (c) 2016, MOTOROLA SOLUTIONS Inc.      #
   #                   All Rights Reserved                      #
   ##############################################################

!
}


function choose_install_directory
{
   #
   # Display choice of installation directory
   #
   while [ 1 ]
   do
      printf "\n"
      printf "Enter:    1 -> Install from CDROM\n"
      printf "          2 -> Install from current directory\n"
      printf "          q -> Quit installation\n"
      printf "\n"
      printf "Choice? "
      read -r directory_choice
      case $directory_choice in
         "1" )
# 	       ('install_source' is defined in 'initialize_variables' function)
	       if [ $install_source = "nofile" ]
	       then
		  printf "\n  --> Error: Missing 'install' file <--\n"
		  exit $FAILURE
	       fi
               break
	       ;;
        "2" ) install_source=`pwd`
               break
               ;;
         "q" ) exit $SUCCESS
               ;;
           
         * ) echo "Please select required choice."
      esac   
   done
}


function conf_shared_libs_cache
{
   #
   # configure the shared library cache
   #
   printf "$(date) .... Configuring the Shared Library Cache ....\n"
   /sbin/ldconfig

   if [[ $? != $SUCCESS ]]
   then
       printf "$(date) .... Configuring the Shared Library Cache FAILED! ....\n"
       install_cleanup
       exit $FAILURE
   fi
} 




function disable_selinux 
{
   # disable immediately
   /usr/sbin/setenforce 0

   # keep disabled at next startup
   sed "s/SELINUX.*=.*enforcing/SELINUX=disabled/g" /etc/selinux/config > /tmp/selinux_config_tmp
   mv -f /tmp/selinux_config_tmp /etc/selinux/config
}




function install_mysql
{
   #
   #  install both the PDR and RNG software.
   #
   echo "install_mysql:: nothing"
}

 
function print_starting_banner
{
   #
   # Print Starting Banner.
   #
   printf "\n.... Upgrade Started ....\n"
}


function print_completion_banner
{
   #
   # Print Completion Banner  
   #
   printf "\n.... Upgrade Completed ....\n"
}


function change_to_install_directory
{
   #
   # Change working directory to installation directory.
   #
   if [[ $PWD != $install_dir ]]
   then
      printf "$(date) .... Changing Current Directory to $install_dir ....\n"
      cd $install_dir
   fi
} 

#previously install_omc_only
function upgrade_omc
{

# rpm instalation 
rpm_cmd='rpm -Uvh'

dep_source="$install_source/dependencies"

if [[ -d $dep_source ]]
then
	if [[ $PWD != $dep_source ]]
	then
		printf "$(date) .... Changing Current Directory to $dep_source ....\n"
		cd $dep_source
	fi
else
	printf "$(date) .... $dep_source directory does not exist! Aborting installation...\n"
	exit $FAILURE
fi


#Tar
$rpm_cmd ./tar-1.15.1-31.el5.i386.rpm

# Upgrade OMC Server
change_to_install_directory

$rpm_cmd --force $install_source/omcserver-mcd-5000-*el5.i386.rpm 


}


function post_install_message
{
cat <<!

  For further configuration procedures, please refer to
  "OMC Operations Manual."
!
}



function do_exit
{
 
   if [ -f $dummy ]
   then
      rm -f $dummy
   fi
   cd $cur_pwd

   print_completion_banner

   echo "server will reboot..."
   sleep 2
   reboot
   #exit $SUCCESS
}

function start_installation
{
   #
   # Print "Installation started" banner
   # and change working directory to
   # installation directory previously
   # chosen by the user.
   #

   print_starting_banner
#   change_to_install_directory  
}


function install_preparation
{
   setup_system
}

function print_in_console_and_syslog
{
    printf "$(date) .... $1 ....\n"
    /usr/bin/logger -t $1
}


function install_system
{
   if [ -x /etc/init.d/doinkd ]
   then
      /sbin/service doinkd stop > /dev/null 2>&1
   fi
   if [ -e $install_source/pdr-clc-release-*-1.noarch.rpm ]
   then
      rpm -U --force $install_source/pdr-clc-release-*-1.noarch.rpm
   fi

   
   #backup html_dir and cgi_bin_dir values
   html_dir_back=$html_dir
   cgi_bin_dir_back=$cgi_bin_dir
   
   if [ -e /opt/Motorola/clc/include/app/pdr_common_defs ]
   then
      . /opt/Motorola/clc/include/app/pdr_common_defs
   fi
   
   #restore html_dir and cgi_bin_dir values
   html_dir=$html_dir_back
   cgi_bin_dir=$cgi_bin_dir_back

   # Install net-snmp-perl needed by key rotate script 
   # if [ -e $install_source/net-snmp-perl-*.i386.rpm ]
   # then
      # rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
      # rpm -U --force $install_source/net-snmp-perl-*.i386.rpm
   # fi

   # User Interface packages installation
   # rpm -U --force $install_source/TermReadKey-*.i386.rpm
   # rpm -U --force $install_source/Want-*.i386.rpm
   # rpm -U --force $install_source/version-*.i386.rpm
   # rpm -U --force $install_source/IO-Prompt-*.i386.rpm

   # ca_devel_exists=`rpm -qa common_agent* | grep devel | wc -l`
   # wdse_devel_exists=`rpm -qa wdse-ucd-snmp* | grep devel | wc -l`
   
   #remove net-snmp packages to avoid conflict with common agent
   uninstall_linux_packages

   # if [[ $ca_devel_exists -eq 1 || $wdse_devel_exists -eq 1 ]]
   # then
      #Common agent packages installation, the two packages should be placed in ONE line
      # rpm -U --force --nodeps $install_source/common_agent-a*.i386.rpm $install_source/common_agent-utils-a*.i386.rpm $install_source/common_agent-devel-a*.i386.rpm    
   # else
      #Common agent packages installation, the three packages should be placed in ONE line
      # rpm -U --force --nodeps $install_source/common_agent-a*.i386.rpm $install_source/common_agent-utils-a*.i386.rpm
   # fi   
   
   # The caui have dependencies from common agent packages 
   # rpm -U --force $install_source/caui-*.i386.rpm

   # Set finally secure mode
   secman --enable-secure --disable-nonsecure
   
   # install PDG system
   if (( $system_option == 1 ))
     then
        determine_install
   fi
   
}


function full_options_install
{

   stop_security_monitor
   upgrade_omc
   install_admin_menu
   #print_in_console_and_syslog "Final Configurations"
   #/opt/Motorola/clc/sbin/linux_config > /dev/null 2>&1   
   update_security_monitor
   if [ -x /etc/init.d/doinkd ]
   then
      /sbin/service doinkd start > /dev/null 2>&1
   fi
   do_exit
 
}


function determine_install
{
  
  has_the_pdr_version_changed
  
  if [[ $ver_change_result = $TRUE ]]
   then
       reduced_options_install
  
  elif [[ $ver_change_result = $FALSE ]]
   then
       full_options_install
  fi
}


function has_the_pdr_version_changed
{
    ver_change_result=$TRUE  
}

function reduced_options_install
{
     stop_security_monitor
     #install_preparation
     start_installation
     upgrade_omc
     install_admin_menu
     #print_in_console_and_syslog "Final Configurations"
     #/opt/Motorola/clc/sbin/linux_config > /dev/null 2>&1
     update_security_monitor
     do_exit
}

function install_admin_menu
{

#install_source="/tmp"

menu_source="$install_source/admin_menu"
export_dir="/etc/opt/Motorola/aaa/uae_menu_drv"
bin_dir="/opt/Motorola/mcd5000/omcserver/bin"

echo "installing admin_menu from $menu_source"

if [[ -d $menu_source ]]
then
                if [[ $PWD != $menu_source ]]
                then
                                # printf "$(date) .... Changing Current Directory to $menu_source ....\n"
                                cd $menu_source
                fi
else
                printf "$(date) .... $menu_source directory does not exist! Aborting installation...\n"
                exit $FAILURE
fi


if [ ! -d $export_dir ]; then
                mkdir -p $export_dir
fi

chmod -R 640  $export_dir
cp $menu_source/*  $export_dir

chmod -R 700  $export_dir
chown -R root:root $export_dir

/etc/sysconfig/network-scripts/ifdown eth0
#$export_dir/ifcfg-eth0_config
/etc/sysconfig/network-scripts/ifup eth0
#service network restart

cp $menu_source/configure_edit_net_config /opt/Motorola/aaa/scripts/

cp $menu_source/omc_ipds_config  $bin_dir
cp $menu_source/issue  /etc/

chmod 700 $bin_dir/omc_ipds_config
chown root:root $bin_dir/omc_ipds_config

cp $menu_source/admin_menu /opt/Motorola/aaa/bin/
chmod 700 /opt/Motorola/aaa/bin/admin_menu

echo "admin_menu installation complete"
}


#################################################################################
# The install script starts here.
#################################################################################

if [ -e /opt/Motorola/clc/include/common/clc_common_defs ]
then
   . /opt/Motorola/clc/include/common/clc_common_defs
fi

umask 027

show_welcome

ver_count=`rpm -qa | grep omcserver | wc -l`
if [ $ver_count -eq 0 ]; then
echo "This is a MCD 5000 OMC server upgrade only CD ." 
echo "A MCD 5000 OMC server isn't installed on this machine." 
echo "The upgrade process has failed."
exit 1
fi

# get the path of the script started
command_line=$0
startup_dir=${command_line%/*}

#in case the command line does not contain path information
if [[ $startup_dir = $command_line ]]
then
   startup_dir="."
fi

initialize_variables
change_to_root $*

choose_install_directory
reduced_options_install

do_exit

############################### End Of Script ###################################
