Commit a0f3b2c851db279f8e6e421b4d8de39c1e1dd295

Authored by Eduardo Lúcio Amorim Costa
1 parent 8fb42ffe
Exists in master

Correção de vários bugs! Agora instalável no RedHat 6.X (ou baseado/CentOS 6.X),…

… Debian 8 (ou baseado/Ubuntu Server 14.X) e SUSE 12.X (ou baseado/openSUSE 13.X)! By Questor
.directory
1 1 [Dolphin]
2 2 PreviewsShown=true
3   -Timestamp=2016,3,23,10,50,49
  3 +Timestamp=2016,5,13,17,48,30
4 4 Version=3
5 5 ViewMode=1
6   -
7   -[Settings]
8   -HiddenFilesShown=true
... ...
ez_i.sh
... ... @@ -273,8 +273,9 @@ f_pack_is_inst() {
273 273  
274 274 Args:
275 275 PACKAGE_NM_P (str): Nome do pacote.
276   - PACK_MANAG (str): Tipo de gerenciador de pacotes. Apenas yum é
277   - suportado. Em caso diverso o script exibe erro e para.
  276 + PACK_MANAG (str): Tipo de gerenciador de pacotes. "yum",
  277 + "apt-get" e "zypper" são suportados. Em caso diverso o script
  278 + exibe erro e para.
278 279 EXIST_MSG_P (Optional[str]): Mensagem a ser exibida se o
279 280 pacote já estiver instalado. Se vazio ou não informado não será
280 281 exibida mensagem.
... ... @@ -309,6 +310,30 @@ f_pack_is_inst() {
309 310 else
310 311 F_PACK_IS_INST_R=0
311 312 fi
  313 + elif [ "$PACK_MANAG" == "apt-get" ] ; then
  314 + if dpkg -s "$PACKAGE_NM_P" &> /dev/null; then
  315 + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$EXIST_MSG_P" ] ; then
  316 + f_div_section
  317 + echo "$EXIST_MSG_P"
  318 + f_div_section
  319 + f_enter_to_cont
  320 + fi
  321 + F_PACK_IS_INST_R=1
  322 + else
  323 + F_PACK_IS_INST_R=0
  324 + fi
  325 + elif [ "$PACK_MANAG" == "zypper" ] ; then
  326 + if zypper se -i --match-word "$PACKAGE_NM_P" > /dev/null 2>&1; then
  327 + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$EXIST_MSG_P" ] ; then
  328 + f_div_section
  329 + echo "$EXIST_MSG_P"
  330 + f_div_section
  331 + f_enter_to_cont
  332 + fi
  333 + F_PACK_IS_INST_R=1
  334 + else
  335 + F_PACK_IS_INST_R=0
  336 + fi
312 337 else
313 338 f_div_section
314 339 echo "ERROR! Not implemented for \"$PACK_MANAG\"!"
... ... @@ -462,6 +487,7 @@ f_is_not_running() {
462 487 CHK_INVERT=0
463 488 fi
464 489 F_IS_NOT_RUNNING_R=0
  490 +
465 491 # NOTE: A verificação "grep -v grep" é para que ele não dê positivo
466 492 # para o próprio comando grep! By Questor
467 493 F_IS_NOT_RUNNING_R=0
... ... @@ -484,6 +510,7 @@ f_is_not_running() {
484 510  
485 511 F_GET_STDERR_R=""
486 512 F_GET_STDOUT_R=""
  513 +F_GET_EXIT_CODE_R=0
487 514 f_get_stderr_stdout() {
488 515 : 'Executar um comando e colocar a saída de stderr e stdout nas
489 516 variáveis "F_GET_STDERR_R" e "F_GET_STDOUT_R"!.
... ... @@ -499,8 +526,9 @@ f_get_stderr_stdout() {
499 526 CMD_TO_EXEC=$1
500 527 F_GET_STDERR_R=""
501 528 F_GET_STDOUT_R=""
502   - unset t_std t_err
503   - eval "$( eval "$CMD_TO_EXEC" 2> >(t_err=$(cat); typeset -p t_err) > >(t_std=$(cat); typeset -p t_std) )"
  529 + unset t_std t_err t_ret
  530 + eval "$( eval "$CMD_TO_EXEC" 2> >(t_err=$(cat); typeset -p t_err) > >(t_std=$(cat); typeset -p t_std); t_ret=$?; typeset -p t_ret )"
  531 + F_GET_EXIT_CODE_R=$t_ret
504 532 F_GET_STDERR_R=$t_err
505 533 F_GET_STDOUT_R=$t_std
506 534 }
... ... @@ -536,7 +564,6 @@ f_ez_mv_bak() {
536 564 SKIP_MSG_P=1
537 565 fi
538 566  
539   -
540 567 MK_BAK=1
541 568 F_BAK_PATH_R=""
542 569 F_BAK_NAME_R=""
... ... @@ -565,6 +592,8 @@ f_error_exit() {
565 592 ERROR_CAUSE_P (Optional[str]): Causa do erro.
566 593 '
567 594  
  595 + EZ_I_S_ON_HOLDER=$EZ_I_SKIP_ON_V
  596 + EZ_I_SKIP_ON_V=0
568 597 ERROR_CAUSE_P=$1
569 598 echo
570 599 f_open_section "E R R O R !"
... ... @@ -575,9 +604,40 @@ f_error_exit() {
575 604 echo "$ERROR_MSG_NOW_P"
576 605 echo
577 606 f_close_section
  607 + EZ_I_SKIP_ON_V=$EZ_I_S_ON_HOLDER
578 608 exit 1
579 609 }
580 610  
  611 +f_warning_msg() {
  612 + : '"Printa" uma mensagem de aviso.
  613 +
  614 + Args:
  615 + WARNING_P (str): aviso.
  616 + ASK_FOR_CONT_P (Optional[int]): 1 - Checa se o usuário deseja
  617 + continuar com a instalação; 0 - Solicita que pressione "enter".
  618 + Padrão 0.
  619 + '
  620 +
  621 + EZ_I_S_ON_HOLDER=$EZ_I_SKIP_ON_V
  622 + EZ_I_SKIP_ON_V=0
  623 + WARNING_P=$1
  624 + ASK_FOR_CONT_P=$2
  625 + if [ -z "$ASK_FOR_CONT_P" ] ; then
  626 + ASK_FOR_CONT_P=0
  627 + fi
  628 + echo
  629 + f_open_section "W A R N I N G !"
  630 + echo "$WARNING_P"
  631 + echo
  632 + f_close_section
  633 + if [ ${ASK_FOR_CONT_P} -eq 0 ] ; then
  634 + f_enter_to_cont
  635 + else
  636 + f_continue
  637 + fi
  638 + EZ_I_SKIP_ON_V=$EZ_I_S_ON_HOLDER
  639 +}
  640 +
581 641 f_continue() {
582 642 : 'Questionar ao usuário se deseja continuar ou parar a instalação.
583 643  
... ... @@ -600,8 +660,344 @@ f_continue() {
600 660 fi
601 661 }
602 662  
  663 +F_SPLIT_R=()
  664 +f_split() {
  665 + : 'Faz "split" em uma dada string e devolve um array.
603 666  
604   -# < --------------------------------------------------------------------------
  667 + Args:
  668 + TARGET_P (str): String alvo do "split".
  669 + DELIMITER_P (Optional[str]): Delimitador usado no "split".
  670 + Se não informado o split vai ser feito por espaços em branco.
  671 +
  672 + Returns:
  673 + F_SPLIT_R (array): Array com a string fornecida separada pelo
  674 + delimitador informado.
  675 + '
  676 +
  677 + F_SPLIT_R=()
  678 + TARGET_P=$1
  679 + DELIMITER_P=$2
  680 + if [ -z "$DELIMITER_P" ] ; then
  681 + DELIMITER_P=" "
  682 + fi
  683 +
  684 + REMOVE_N=1
  685 + if [ "$DELIMITER_P" == "\n" ] ; then
  686 + REMOVE_N=0
  687 + fi
  688 +
  689 + if [ ${REMOVE_N} -eq 1 ] ; then
  690 +
  691 + # NOTE: Devido a limitações do bash temos alguns problemas para
  692 + # poder obter a saída de um split via awk dentro de um array e
  693 + # por isso precisamos do uso da "quebra de linha" (\n) para
  694 + # termos sucesso! Visto isso, removemos as quebras de linha
  695 + # momentaneamente depois as reintegramos! By Questor
  696 + TARGET_P=$(echo "$TARGET_P" | awk 'BEGIN {RS="dn" } {gsub("\n","£§¢¬¨") ;printf $0 }')
  697 + fi
  698 +
  699 + SPLIT_NOW=$(awk -F"$DELIMITER_P" '{for(i=1;i<=NF;i++){printf "%s\n", $i}}' <<<"${TARGET_P}")
  700 +
  701 + while IFS= read -r LINE_NOW; do
  702 + if [ ${REMOVE_N} -eq 1 ] ; then
  703 + LN_NOW_WITH_N=$(awk 'BEGIN {RS="dn"} {gsub("£§¢¬¨","\n") ;printf $0 }' <<<"${LINE_NOW}")
  704 + F_SPLIT_R+=("$LN_NOW_WITH_N")
  705 + else
  706 + F_SPLIT_R+=("$LINE_NOW")
  707 + fi
  708 + done <<< "$SPLIT_NOW"
  709 +}
  710 +
  711 +F_ABOUT_DISTRO_R=()
  712 +f_about_distro() {
  713 + : 'Obter informações sobre a distro.
  714 +
  715 + Returns:
  716 + F_ABOUT_DISTRO_R (array): Array com informações sobre a
  717 + distro na seguinte ordem: NAME, VERSION, BASED e ARCH.
  718 + '
  719 +
  720 + F_ABOUT_DISTRO_R=()
  721 + f_get_stderr_stdout "cat /etc/*-release"
  722 + ABOUT_INFO=$F_GET_STDOUT_R
  723 +
  724 + if [[ $ABOUT_INFO == *"ID=debian"* ]] ; then
  725 + f_split "$ABOUT_INFO" "\n"
  726 + F_SPLIT_R_0=("${F_SPLIT_R[@]}")
  727 + TOTAL_0=${#F_SPLIT_R_0[*]}
  728 + for (( i=0; i<=$(( $TOTAL_0 -1 )); i++ )) ; do
  729 + f_split "${F_SPLIT_R_0[$i]}" "="
  730 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  731 + TOTAL_1=${#F_SPLIT_R_1[*]}
  732 + for (( o=0; o<=$(( $TOTAL_1 -1 )); o++ )) ; do
  733 + p=$[$o+1]
  734 + case "${F_SPLIT_R_1[$o]}" in
  735 + "NAME")
  736 + f_split "${F_SPLIT_R_1[$p]}" "\""
  737 + F_SPLIT_R_2=("${F_SPLIT_R[@]}")
  738 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_2[1]}")
  739 + ;;
  740 + "VERSION_ID")
  741 + f_split "${F_SPLIT_R_1[$p]}" "\""
  742 + F_SPLIT_R_3=("${F_SPLIT_R[@]}")
  743 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_3[1]}")
  744 + ;;
  745 + *)
  746 +
  747 + ;;
  748 + esac
  749 + done
  750 + done
  751 + F_ABOUT_DISTRO_R+=("Debian")
  752 + elif [[ $ABOUT_INFO == *"ID=\"sles\""* ]] ; then
  753 + f_split "$ABOUT_INFO" "\n"
  754 + F_SPLIT_R_0=("${F_SPLIT_R[@]}")
  755 + TOTAL_0=${#F_SPLIT_R_0[*]}
  756 + for (( i=0; i<=$(( $TOTAL_0 -1 )); i++ )) ; do
  757 + f_split "${F_SPLIT_R_0[$i]}" "="
  758 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  759 + TOTAL_1=${#F_SPLIT_R_1[*]}
  760 + for (( o=0; o<=$(( $TOTAL_1 -1 )); o++ )) ; do
  761 + p=$[$o+1]
  762 + case "${F_SPLIT_R_1[$o]}" in
  763 + "NAME")
  764 + f_split "${F_SPLIT_R_1[$p]}" "\""
  765 + F_SPLIT_R_2=("${F_SPLIT_R[@]}")
  766 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_2[1]}")
  767 + ;;
  768 + "VERSION_ID")
  769 + f_split "${F_SPLIT_R_1[$p]}" "\""
  770 + F_SPLIT_R_3=("${F_SPLIT_R[@]}")
  771 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_3[1]}")
  772 + ;;
  773 + *)
  774 +
  775 + ;;
  776 + esac
  777 + done
  778 + done
  779 + F_ABOUT_DISTRO_R+=("Suse")
  780 + elif [[ $ABOUT_INFO == *"ID=opensuse"* ]] ||
  781 + [[ $ABOUT_INFO == *"ID_LIKE=\"suse\""* ]] ; then
  782 + f_split "$ABOUT_INFO" "\n"
  783 + F_SPLIT_R_0=("${F_SPLIT_R[@]}")
  784 + TOTAL_0=${#F_SPLIT_R_0[*]}
  785 + for (( i=0; i<=$(( $TOTAL_0 -1 )); i++ )) ; do
  786 + f_split "${F_SPLIT_R_0[$i]}" "="
  787 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  788 + TOTAL_1=${#F_SPLIT_R_1[*]}
  789 + for (( o=0; o<=$(( $TOTAL_1 -1 )); o++ )) ; do
  790 + p=$[$o+1]
  791 + case "${F_SPLIT_R_1[$o]}" in
  792 + "NAME")
  793 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[$p]}")
  794 + ;;
  795 + "VERSION_ID")
  796 + f_split "${F_SPLIT_R_1[$p]}" "\""
  797 + F_SPLIT_R_3=("${F_SPLIT_R[@]}")
  798 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_3[1]}")
  799 + ;;
  800 + *)
  801 +
  802 + ;;
  803 + esac
  804 + done
  805 + done
  806 + F_ABOUT_DISTRO_R+=("Suse")
  807 + elif [[ $ABOUT_INFO == *"DISTRIB_ID=Ubuntu"* ]] ||
  808 + [[ $ABOUT_INFO == *"ID_LIKE=debian"* ]] ; then
  809 + f_split "$ABOUT_INFO" "\n"
  810 + F_SPLIT_R_0=("${F_SPLIT_R[@]}")
  811 + TOTAL_0=${#F_SPLIT_R_0[*]}
  812 + for (( i=0; i<=$(( $TOTAL_0 -1 )); i++ )) ; do
  813 + f_split "${F_SPLIT_R_0[$i]}" "="
  814 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  815 + TOTAL_1=${#F_SPLIT_R_1[*]}
  816 + for (( o=0; o<=$(( $TOTAL_1 -1 )); o++ )) ; do
  817 + p=$[$o+1]
  818 + case "${F_SPLIT_R_1[$o]}" in
  819 + "DISTRIB_ID")
  820 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[$p]}")
  821 + ;;
  822 + "DISTRIB_RELEASE")
  823 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[$p]}")
  824 + ;;
  825 + *)
  826 +
  827 + ;;
  828 + esac
  829 + done
  830 + done
  831 + F_ABOUT_DISTRO_R+=("Debian")
  832 + elif [[ $ABOUT_INFO == *"CentOS release "* ]] ; then
  833 + f_split "$ABOUT_INFO" "\n"
  834 + F_SPLIT_R_0=("${F_SPLIT_R[1]}")
  835 + f_split "${F_SPLIT_R_0[0]}" " "
  836 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  837 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[0]}")
  838 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[2]}")
  839 + F_ABOUT_DISTRO_R+=("RedHat")
  840 + elif [[ $ABOUT_INFO == *"Red Hat Enterprise Linux Server release "* ]] ; then
  841 + f_split "$ABOUT_INFO" "\n"
  842 + F_SPLIT_R_0=("${F_SPLIT_R[1]}")
  843 + f_split "${F_SPLIT_R_0[0]}" " "
  844 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  845 + F_ABOUT_DISTRO_R+=("Red Hat Enterprise Linux Server")
  846 + F_ABOUT_DISTRO_R+=("${F_SPLIT_R_1[6]}")
  847 + F_ABOUT_DISTRO_R+=("RedHat")
  848 + else
  849 + F_ABOUT_DISTRO_R+=("Unknown")
  850 + F_ABOUT_DISTRO_R+=("Unknown")
  851 + F_ABOUT_DISTRO_R+=("Unknown")
  852 + fi
  853 + F_ABOUT_DISTRO_R+=($(arch))
  854 +}
  855 +
  856 +F_IS_ROOT_R=1
  857 +f_is_root() {
  858 + : 'Checar se o usuário é root.
  859 +
  860 + Args:
  861 + CHK_ONLY_P (Optional[int]): 1 - Apenas verifica e retorna o
  862 + resultado; 0 - Se não for root emite erro e encerra a execução.
  863 + Padrão 0.
  864 +
  865 + Returns:
  866 + F_IS_ROOT_R (int): 1 - É root; 0 - Não é root.
  867 + '
  868 +
  869 + CHK_ONLY_P=$1
  870 + if [ -z "$CHK_ONLY_P" ] ; then
  871 + CHK_ONLY_P=0
  872 + fi
  873 +
  874 + F_IS_ROOT_R=1
  875 + if [[ $EUID -ne 0 ]]; then
  876 + f_enter_to_cont "ERROR! You need to be root!"
  877 + F_IS_ROOT_R=0
  878 + if [ ${CHK_ONLY_P} -eq 0 ] ; then
  879 + f_error_exit
  880 + fi
  881 + fi
  882 +}
  883 +
  884 +F_CHK_DISTRO_STATUS_R=""
  885 +f_chk_distro_status() {
  886 + : 'Verifica se a distro informada está subscrita e/ou registrada
  887 + e/ou ativa perante os recursos informados.
  888 +
  889 + Args:
  890 + DISTRO_NAME_P (str): Nome da distro sobre a qual será executada
  891 + verificação.
  892 + RESOURCES_ARR_P (str): Array com a lista de recursos a serem
  893 + verificados na distro alvo.
  894 +
  895 + Returns:
  896 + F_CHK_DISTRO_STATUS_R (str): Possui a saída do comando de
  897 + verificação executado.
  898 + '
  899 +
  900 + F_CHECK_RHEL_R=""
  901 + DISTRO_NAME_P=$1
  902 + RESOURCES_ARR_P=("${!2}")
  903 + TOTAL_2=${#RESOURCES_ARR_P[*]}
  904 +
  905 + RES_OK_ARR=()
  906 + REDHAT_ACTV=0
  907 +
  908 + CHK_RES_CMD=""
  909 + if [ "$DISTRO_NAME_P" == "RedHat" ] ; then
  910 + CHK_RES_CMD="subscription-manager list --consumed"
  911 + f_get_stderr_stdout "$CHK_RES_CMD"
  912 + f_split "$F_GET_STDOUT_R" "Subscription Name:"
  913 + elif [ "$DISTRO_NAME_P" == "SLES" ] ; then
  914 + CHK_RES_CMD="zypper sl"
  915 + f_get_stderr_stdout "$CHK_RES_CMD"
  916 + f_split "$F_GET_STDOUT_R" "\n"
  917 + fi
  918 +
  919 + F_SPLIT_R_0=("${F_SPLIT_R[@]}")
  920 + TOTAL_0=${#F_SPLIT_R_0[*]}
  921 + for (( i=0; i<=$(( $TOTAL_0 -1 )); i++ )) ; do
  922 + if [[ "$DISTRO_NAME_P" == "RedHat" ]] ; then
  923 + f_split "${F_SPLIT_R_0[$i]}" "\n"
  924 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  925 + TOTAL_1=${#F_SPLIT_R_1[*]}
  926 + CHK_ACTV=0
  927 + for (( o=0; o<=$(( $TOTAL_1 -1 )); o++ )) ; do
  928 + if [[ "${F_SPLIT_R_1[$o]}" == "Provides:"* ]] ; then
  929 + CHK_ACTV=1
  930 + fi
  931 + if [ ${CHK_ACTV} -eq 1 ] ; then
  932 + for (( w=0; w<=$(( $TOTAL_2 -1 )); w++ )) ; do
  933 + if [[ "${F_SPLIT_R_1[$o]}" == *"${RESOURCES_ARR_P[$w]}" ]] ; then
  934 + RES_OK_ARR+=($w)
  935 + break
  936 + fi
  937 + done
  938 + if [ ${REDHAT_ACTV} -eq 0 ] &&
  939 + [[ "${F_SPLIT_R_1[$o]}" == "Active:"* ]] &&
  940 + [[ "${F_SPLIT_R_1[$o]}" == *"True" ]] ; then
  941 + REDHAT_ACTV=1
  942 + fi
  943 + fi
  944 + done
  945 + elif [[ "$DISTRO_NAME_P" == "SLES" ]] ; then
  946 + REDHAT_ACTV=1
  947 + f_split "${F_SPLIT_R_0[$i]}" "|"
  948 + F_SPLIT_R_1=("${F_SPLIT_R[@]}")
  949 + for (( w=0; w<=$(( $TOTAL_2 -1 )); w++ )) ; do
  950 + if [[ "${F_SPLIT_R_1[1]}" == *"${RESOURCES_ARR_P[$w]}"* ]] ; then
  951 + if [[ "${F_SPLIT_R_1[3]}" == *"Yes"* ]] ; then
  952 + if [[ "${F_SPLIT_R_1[5]}" == *"Yes"* ]] ; then
  953 + RES_OK_ARR+=($w)
  954 + break
  955 + fi
  956 + fi
  957 + fi
  958 + done
  959 + fi
  960 + done
  961 +
  962 + WARNINGS_MSGS=()
  963 + TOTAL_3=${#RES_OK_ARR[*]}
  964 + for (( z=0; z<=$(( $TOTAL_2 -1 )); z++ )) ; do
  965 + RES_OK_NOW=1
  966 + for (( t=0; t<=$(( $TOTAL_3 -1 )); t++ )) ; do
  967 + if (( ${RES_OK_ARR[$t]} == $z )); then
  968 + RES_OK_NOW=0
  969 + break
  970 + fi
  971 + done
  972 + if (( $RES_OK_NOW == 1 )); then
  973 + WARNINGS_MSGS+=("$DISTRO_NAME_P does not have access to this resource: \"${RESOURCES_ARR_P[$z]}\".")
  974 + fi
  975 + done
  976 +
  977 + TOTAL_4=${#WARNINGS_MSGS[*]}
  978 + WAR_MSGS_STR=""
  979 + USE_NEWLINE=""
  980 + if [ ! $TOTAL_4 -eq 0 ] || [ $REDHAT_ACTV -eq 0 ]; then
  981 + WAR_MSGS_STR="SOME PROBLEM APPEAR TO HAVE BEEN DETECTED ON"
  982 + if [[ "$DISTRO_NAME_P" == "RedHat" ]] ; then
  983 + WAR_MSGS_STR+=" REDHAT SUBSCRIPTION! "
  984 + elif [[ "$DISTRO_NAME_P" == "SLES" ]] ; then
  985 + WAR_MSGS_STR+=" SLES REGISTRATION! "
  986 + fi
  987 + WAR_MSGS_STR+="PLEASE CHECK IT!"
  988 + for (( y=0; y<=$(( $TOTAL_4 -1 )); y++ )) ; do
  989 + if (( $y == 0 )); then
  990 + WAR_MSGS_STR+=$'\n\n'
  991 + else
  992 + USE_NEWLINE=$'\n'
  993 + fi
  994 + WAR_MSGS_STR+="$USE_NEWLINE -> ${WARNINGS_MSGS[$y]}"
  995 + done
  996 + WAR_MSGS_STR+=$'\n\n'"FOR MORE INFORMATION TRY: \"$CHK_RES_CMD\"."
  997 + f_warning_msg "$WAR_MSGS_STR" 1
  998 + fi
  999 + F_CHK_DISTRO_STATUS_R=$F_GET_STDOUT_R
  1000 +}
605 1001  
606 1002 # > --------------------------------------------------------------------------
607 1003 # GRAFICO!
... ...
install.sh
1 1 #!/bin/bash
2 2  
  3 +# > -----------------------------------------
  4 +# Run that script with bash even if the user use sh/dash or any sh like
  5 +# interpreter. This way it correctly works with either:
  6 +# "sh ./my_script.sh" or "bash ./my_script.sh" or "./my_script.sh"
  7 +
  8 +if [ -z "$BASH_VERSION" ]
  9 +then
  10 + exec bash "$0" "$@"
  11 +fi
  12 +
  13 +# < -----------------------------------------
  14 +
3 15 # NOTE: Evita problemas com caminhos relativos! By Questor
4 16 SCRIPTDIR_V="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5 17 . $SCRIPTDIR_V/ez_i.sh
... ... @@ -23,17 +35,27 @@ Have fun! =D
23 35 EOF
24 36  
25 37 read -d '' WARNINGS_F <<"EOF"
26   -- Installer designed for CentOS 6 AMD64/RHEL 6 AMD64!
  38 +- This installer is compatible with RHEL, SUSE, Debian or distributions
  39 +based on these.
27 40  
28 41 - We RECOMMEND you...
29 42 Install all the components (answer yes to everything). Except
30 43 contrary guidance!
31 44 Check for previous installations! If there is previous
32 45 installations consider this variant in the process!
  46 + Although this is not mandatory, do the installation process in an
  47 + exclusive machine for this.
  48 +
  49 +- We NOTICE you...
  50 + This installer assumes that the target distribution has a "standard
  51 + setup". This may include components such as firewall, SELinux
  52 + and others.
  53 +
33 54 - We WARNING you...
34   - USE AT YOUR OWN RISK: WE ARE NOT RESPONSIBLE FOR ANY DAMAGE TO
35   -YOURSELF, HARDWARE, OR CO-WORKERS. EXCEPT IN CASES WHERE THERE ARE
36   -SIGNED CONTRACT THAT REGULATES THIS!
  55 + THIS INSTALLER AND RESULTING PRODUCTS COMES WITH ABSOLUTELY NO WARRANTY!
  56 + USE AT YOUR OWN RISK! WE ARE NOT RESPONSIBLE FOR ANY DAMAGE TO YOURSELF,
  57 + HARDWARE, OR CO-WORKERS. EXCEPT IN CASES WHERE THERE ARE SIGNED CONTRACT
  58 + THAT REGULATES THIS!
37 59 EOF
38 60  
39 61 read -d '' COMPANY_F <<"EOF"
... ... @@ -62,13 +84,18 @@ TERMS_LICEN_F=&quot;&quot;
62 84  
63 85 # < --------------------------------------------------------------------------
64 86  
  87 +# > -----------------------------------------
  88 +# Checar se o usuário é root!
  89 +
  90 +f_is_root
  91 +
  92 +# < -----------------------------------------
  93 +
65 94 # > --------------------------------------------------------------------------
66 95 # INTRUÇÕES!
67 96 # --------------------------------------
68 97  
69 98 read -d '' INSTRUCT_F <<"EOF"
70   -- To run this script YOU NEED to be root!
71   -
72 99 - TO CANCEL installation at any time use Ctrl+c!
73 100 EOF
74 101  
... ... @@ -77,6 +104,128 @@ INSTRUCT_F=&quot;&quot;
77 104  
78 105 # < --------------------------------------------------------------------------
79 106  
  107 +DISTRO_TYPE=""
  108 +DISTRO_NAME=""
  109 +# > -----------------------------------------
  110 +# Checar se a distro é compatível!
  111 +
  112 +f_open_section
  113 +f_about_distro
  114 +f_div_section
  115 +echo "DISTRO INFORMATION:"
  116 +f_div_section
  117 +echo "NAME: .... ${F_ABOUT_DISTRO_R[0]}"
  118 +echo "VERSION: . ${F_ABOUT_DISTRO_R[1]}"
  119 +echo "BASED: ... ${F_ABOUT_DISTRO_R[2]}"
  120 +echo "ARCH: .... ${F_ABOUT_DISTRO_R[3]}"
  121 +f_div_section
  122 +
  123 +if [[ "${F_ABOUT_DISTRO_R[2]}" == "Debian" ]] || [[ "${F_ABOUT_DISTRO_R[2]}" == "RedHat" ]] ||
  124 + [[ "${F_ABOUT_DISTRO_R[2]}" == "Suse" ]] ; then
  125 + if [[ "${F_ABOUT_DISTRO_R[2]}" == "Debian" ]] ; then
  126 + DISTRO_TYPE="DEB"
  127 + if [[ "${F_ABOUT_DISTRO_R[0]}" == "Ubuntu" ]] ; then
  128 + DISTRO_NAME="Ubuntu"
  129 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "14.04" ]] ; then
  130 + f_div_section
  131 + f_yes_no "Linux version may be incompatible with this installer (expected: 14.04/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  132 + f_div_section
  133 + if [ ${YES_NO_R} -eq 0 ] ; then
  134 + exit 0
  135 + fi
  136 + fi
  137 + elif [[ "${F_ABOUT_DISTRO_R[0]}" == "Debian GNU/Linux" ]] ; then
  138 + DISTRO_NAME="Debian"
  139 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "8" ]] ; then
  140 + f_div_section
  141 + f_yes_no "Linux version may be incompatible with this installer (expected: 8/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  142 + f_div_section
  143 + if [ ${YES_NO_R} -eq 0 ] ; then
  144 + exit 0
  145 + fi
  146 + fi
  147 + else
  148 + f_div_section
  149 + f_yes_no "Linux distro may be incompatible with this installer (expected: Ubuntu or Debian/obtained: ${F_ABOUT_DISTRO_R[0]})! Continue?"
  150 + f_div_section
  151 + if [ ${YES_NO_R} -eq 0 ] ; then
  152 + exit 0
  153 + fi
  154 + fi
  155 + elif [[ "${F_ABOUT_DISTRO_R[2]}" == "RedHat" ]] ; then
  156 + DISTRO_TYPE="RH"
  157 + if [[ "${F_ABOUT_DISTRO_R[0]}" == "Red Hat Enterprise Linux Server" ]] ; then
  158 + DISTRO_NAME="RedHat"
  159 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "6."* ]] ; then
  160 + f_div_section
  161 + f_yes_no "Linux version may be incompatible with this installer (expected: 6.X/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  162 + f_div_section
  163 + if [ ${YES_NO_R} -eq 0 ] ; then
  164 + exit 0
  165 + fi
  166 + fi
  167 + elif [[ "${F_ABOUT_DISTRO_R[0]}" == "CentOS" ]] ; then
  168 + DISTRO_NAME="CentOS"
  169 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "6."* ]] ; then
  170 + f_div_section
  171 + f_yes_no "Linux version may be incompatible with this installer (expected: 6.X/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  172 + f_div_section
  173 + if [ ${YES_NO_R} -eq 0 ] ; then
  174 + exit 0
  175 + fi
  176 + fi
  177 + else
  178 + f_div_section
  179 + f_yes_no "Linux distro may be incompatible with this installer (expected: CentOS or Red Hat Enterprise Linux Server/obtained: ${F_ABOUT_DISTRO_R[0]})! Continue?"
  180 + f_div_section
  181 + if [ ${YES_NO_R} -eq 0 ] ; then
  182 + exit 0
  183 + fi
  184 + fi
  185 + elif [[ "${F_ABOUT_DISTRO_R[2]}" == "Suse" ]] ; then
  186 + DISTRO_TYPE="SUSE"
  187 + if [[ "${F_ABOUT_DISTRO_R[0]}" == "openSUSE" ]] ; then
  188 + DISTRO_NAME="openSUSE"
  189 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "13."* ]] ; then
  190 + f_div_section
  191 + f_yes_no "Linux version may be incompatible with this installer (expected: 13.X/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  192 + f_div_section
  193 + if [ ${YES_NO_R} -eq 0 ] ; then
  194 + exit 0
  195 + fi
  196 + fi
  197 + elif [[ "${F_ABOUT_DISTRO_R[0]}" == "SLES" ]] ; then
  198 + DISTRO_NAME="SLES"
  199 + if [[ "${F_ABOUT_DISTRO_R[1]}" != "12."* ]] ; then
  200 + f_div_section
  201 + f_yes_no "Linux version may be incompatible with this installer (expected: 12.X/obtained: ${F_ABOUT_DISTRO_R[1]})! Continue?"
  202 + f_div_section
  203 + if [ ${YES_NO_R} -eq 0 ] ; then
  204 + exit 0
  205 + fi
  206 + fi
  207 + else
  208 + f_div_section
  209 + f_yes_no "Linux distro may be incompatible with this installer (expected: openSUSE or SUSE Linux Enterprise Server/obtained: ${F_ABOUT_DISTRO_R[0]})! Continue?"
  210 + f_div_section
  211 + if [ ${YES_NO_R} -eq 0 ] ; then
  212 + exit 0
  213 + fi
  214 + fi
  215 + fi
  216 +
  217 + if [[ "${F_ABOUT_DISTRO_R[3]}" != "x86_64" ]] ; then
  218 + f_enter_to_cont "Linux architecture completely incompatible with this installer (expected: x86_64/obtained: ${F_ABOUT_DISTRO_R[3]})!"
  219 + exit 0
  220 + fi
  221 +else
  222 + f_enter_to_cont "Linux distro completely incompatible with this installer (expected: Debian(or based) or RedHat(or based) or SUSE(or based)/obtained: ${F_ABOUT_DISTRO_R[2]})!"
  223 + exit 0
  224 +fi
  225 +f_close_section
  226 +
  227 +# < -----------------------------------------
  228 +
80 229 # > -----------------------------------------
81 230 # Dá ao usuário mais avançado a possibilideade de usar o instalador
82 231 # simplificado!
... ... @@ -86,7 +235,7 @@ INSTRUCT_F=&quot;&quot;
86 235 SIMPLE_INST=0
87 236 if [ ${SIMPLE_INST} -eq 0 ] ; then
88 237 f_open_section
89   - f_yes_no "Use simple install (using a default value for most of the options)?"
  238 + f_yes_no "Use simple install (use default values for most of the options)?"
90 239 if [ ${YES_NO_R} -eq 1 ] ; then
91 240  
92 241 # NOTE: Essa variável serve apenas para "preservar" o valor
... ... @@ -111,85 +260,93 @@ fi
111 260 # Garantir o encodamento correto para evitar problemas de
112 261 # compatibilidade!
113 262  
114   -EZ_I_SKIP_ON_V=$SIMPLE_INST
115   -f_open_section
116   -read -d '' TITLE_F <<"EOF"
117   -Set terminal encode? (recommended for Windows terminal clients)
118   -EOF
119   -
120   -f_yes_no "$TITLE_F"
121   -TITLE_F=""
122   -if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
123   - export LANG=pt_BR.utf8
  263 +if [ ${SIMPLE_INST} -eq 0 ] ; then
  264 + EZ_I_SKIP_ON_V=$SIMPLE_INST
  265 + f_open_section
  266 + f_yes_no "Set terminal encode? (in some cases recommended for Windows ssh clients)"
  267 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  268 + export LANG=pt_BR.utf8
  269 + fi
  270 + f_close_section
124 271 fi
125   -f_close_section
126 272  
127 273 # < -----------------------------------------
128 274  
129 275 # > -----------------------------------------
130 276 # Desabilita o SElinux!
131 277  
132   -EZ_I_SKIP_ON_V=0
133   -f_open_section
134   -read -d '' TITLE_F <<"EOF"
135   -Disable SElinux (use "y" if you never did it)?
136   -EOF
137   -
138   -f_yes_no "$TITLE_F"
139   -TITLE_F=""
140   -if [ ${YES_NO_R} -eq 1 ] ; then
141   - setenforce 0
142   -
143   - # NOTE: As condições abaixo visam evitar que o arquivo seja
144   - # desnecessariamente e erroneamente modificado! By Questor
145   - EZ_I_SKIP_ON_V=$SIMPLE_INST
146   - f_fl_cont_str "# SELINUX=enforcing" "/etc/sysconfig/selinux" "The file \"/etc/sysconfig/selinux\" probably has already been changed! Check it!"
  278 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
147 279 EZ_I_SKIP_ON_V=0
148   - if [ ${FL_CONT_STR_R} -eq 0 ] ; then
149   - f_fl_cont_str "SELINUX=disabled" "/etc/sysconfig/selinux"
  280 + f_open_section
  281 + f_yes_no "Disable SElinux (use "y" if you never did it)?"
  282 + if [ ${YES_NO_R} -eq 1 ] ; then
  283 + setenforce 0
  284 +
  285 + # NOTE: As condições abaixo visam evitar que o arquivo seja
  286 + # desnecessariamente e erroneamente modificado! By Questor
  287 + EZ_I_SKIP_ON_V=$SIMPLE_INST
  288 + f_fl_cont_str "# SELINUX=enforcing" "/etc/sysconfig/selinux" "The file \"/etc/sysconfig/selinux\" probably has already been changed! Check it!"
  289 + EZ_I_SKIP_ON_V=0
150 290 if [ ${FL_CONT_STR_R} -eq 0 ] ; then
151   - f_ez_sed "SELINUX=enforcing" "# SELINUX=enforcing\nSELINUX=disabled" "/etc/sysconfig/selinux"
  291 + f_fl_cont_str "SELINUX=disabled" "/etc/sysconfig/selinux"
  292 + if [ ${FL_CONT_STR_R} -eq 0 ] ; then
  293 + f_ez_sed "SELINUX=enforcing" "# SELINUX=enforcing\nSELINUX=disabled" "/etc/sysconfig/selinux"
  294 + fi
152 295 fi
153 296 fi
  297 + f_close_section
154 298 fi
155   -f_close_section
156 299  
157 300 # < -----------------------------------------
158 301  
159 302 # > -----------------------------------------
160   -# Instala os componentes de base usados pela especificação LightBase!
  303 +# Atualizar a distro (repositório)!
161 304  
162 305 EZ_I_SKIP_ON_V=$SIMPLE_INST
163   -f_open_section
164   -read -d '' TITLE_F <<"EOF"
165   -Install base components?
166   -EOF
167   -
168   -f_yes_no "$TITLE_F"
169   -TITLE_F=""
170   -if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
171   - f_pack_is_inst "gcc-c++" "yum" "\"gcc-c++\" already installed!"
172   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
173   - yum -y install gcc-c++
  306 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  307 + if [[ "$DISTRO_NAME" == "RedHat" ]] ; then
  308 + RESOURCES_ARR_P=("Red Hat Enterprise Linux Server")
  309 + f_chk_distro_status "$DISTRO_NAME" RESOURCES_ARR_P[@]
174 310 fi
175   - f_pack_is_inst "zlib-devel" "yum" "\"zlib-devel\" already installed!"
176   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
177   - yum -y install zlib-devel
  311 + f_div_section
  312 + f_yes_no "Update your distro? (\"y\" highly recommended)"
  313 + f_div_section
  314 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  315 + yum -y update
178 316 fi
179   - f_pack_is_inst "openssl-devel" "yum" "\"openssl-devel\" already installed!"
  317 + f_pack_is_inst "git" "yum" "\"git\" already installed!"
180 318 if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
181   - yum -y install openssl-devel
  319 + yum -y install git
182 320 fi
183   - f_pack_is_inst "postgresql-devel" "yum" "\"postgresql-devel\" already installed!"
  321 +elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  322 + f_div_section
  323 + f_yes_no "Update your distro? (\"y\" highly recommended)"
  324 + f_div_section
  325 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  326 + apt-get -y update
  327 + fi
  328 + f_pack_is_inst "git" "apt-get" "\"git\" already installed!"
184 329 if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
185   - yum -y install postgresql-devel
  330 + apt-get -y install git
186 331 fi
187   - f_pack_is_inst "git" "yum" "\"git\" already installed!"
  332 +elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  333 + if [[ "$DISTRO_NAME" == "SLES" ]] ; then
  334 + RESOURCES_ARR_P=("SUSE_Linux_Enterprise_Server_12_SP1_x86_64"
  335 +"SUSE_Linux_Enterprise_Software_Development_Kit_12_SP1_x86_64"
  336 +"Web_and_Scripting_Module_12_x86_64")
  337 + f_chk_distro_status "SLES" RESOURCES_ARR_P[@]
  338 + fi
  339 + f_div_section
  340 + f_yes_no "Update your distro? (\"y\" highly recommended)"
  341 + f_div_section
  342 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  343 + zypper --non-interactive update
  344 + fi
  345 + f_pack_is_inst "git-core" "zypper" "\"git-core\" already installed!"
188 346 if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
189   - yum -y install git
  347 + zypper --non-interactive install git-core
190 348 fi
191 349 fi
192   -f_close_section
193 350  
194 351 # < -----------------------------------------
195 352  
... ... @@ -221,19 +378,130 @@ f_close_section
221 378 # < -----------------------------------------
222 379  
223 380 # > -----------------------------------------
  381 +# Instalar pacotes que são comuns a determinados componentes!
  382 +
  383 +F_COM_PKS_INSTALLED=0
  384 +f_common_packs() {
  385 + : 'Instalar pacotes que são comuns a determinados componentes.'
  386 +
  387 + if [ ${F_COM_PKS_INSTALLED} -eq 0 ] ; then
  388 + f_pack_is_inst "build-essential" "apt-get" "\"build-essential\" already installed!"
  389 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  390 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  391 + f_pack_is_inst "gcc-c++" "yum" "\"gcc-c++\" already installed!"
  392 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  393 + yum -y install gcc-c++
  394 + fi
  395 + f_pack_is_inst "autoconf" "yum" "\"autoconf\" already installed!"
  396 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  397 + yum -y install autoconf
  398 + fi
  399 + f_pack_is_inst "automake" "yum" "\"automake\" already installed!"
  400 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  401 + yum -y install automake
  402 + fi
  403 + f_pack_is_inst "libtool" "yum" "\"libtool\" already installed!"
  404 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  405 + yum -y install libtool
  406 + fi
  407 + f_pack_is_inst "zlib-devel" "yum" "\"zlib-devel\" already installed!"
  408 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  409 + yum -y install zlib-devel
  410 + fi
  411 + f_pack_is_inst "openssl-devel" "yum" "\"openssl-devel\" already installed!"
  412 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  413 + yum -y install openssl-devel
  414 + fi
  415 + f_pack_is_inst "postgresql-devel" "yum" "\"postgresql-devel\" already installed!"
  416 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  417 + yum -y install postgresql-devel
  418 + fi
  419 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  420 + f_pack_is_inst "g++" "apt-get" "\"g++\" already installed!"
  421 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  422 + apt-get -y install g++
  423 + fi
  424 + f_pack_is_inst "autoconf" "apt-get" "\"autoconf\" already installed!"
  425 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  426 + apt-get -y install autoconf
  427 + fi
  428 + f_pack_is_inst "make" "apt-get" "\"make\" already installed!"
  429 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  430 + apt-get -y install make
  431 + fi
  432 + f_pack_is_inst "libtool" "apt-get" "\"libtool\" already installed!"
  433 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  434 + apt-get -y install libtool
  435 + fi
  436 + f_pack_is_inst "zlib1g-dev" "apt-get" "\"zlib1g-dev\" already installed!"
  437 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  438 + apt-get -y install zlib1g-dev
  439 + fi
  440 + f_pack_is_inst "libssl-dev" "apt-get" "\"libssl-dev\" already installed!"
  441 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  442 + apt-get -y install libssl-dev
  443 + fi
  444 + f_pack_is_inst "dh-exec" "apt-get" "\"dh-exec\" already installed!"
  445 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  446 + apt-get -y install dh-exec
  447 + fi
  448 + f_pack_is_inst "libpq-dev" "apt-get" "\"libpq-dev\" already installed!"
  449 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  450 + apt-get -y install libpq-dev
  451 + fi
  452 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  453 + f_pack_is_inst "gcc-c++" "zypper" "\"gcc-c++\" already installed!"
  454 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  455 + zypper --non-interactive install gcc-c++
  456 + fi
  457 + if [[ "$DISTRO_NAME" != "SLES" ]] ; then
  458 + f_pack_is_inst "autoconf" "zypper" "\"autoconf\" already installed!"
  459 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  460 + zypper --non-interactive install autoconf
  461 + fi
  462 + f_pack_is_inst "automake" "zypper" "\"automake\" already installed!"
  463 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  464 + zypper --non-interactive install automake
  465 + fi
  466 + f_pack_is_inst "make" "zypper" "\"make\" already installed!"
  467 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  468 + zypper --non-interactive install make
  469 + fi
  470 + f_pack_is_inst "libtool" "zypper" "\"libtool\" already installed!"
  471 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  472 + zypper --non-interactive install libtool
  473 + fi
  474 + fi
  475 + f_pack_is_inst "zlib-devel" "zypper" "\"zlib-devel\" already installed!"
  476 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  477 + zypper --non-interactive install zlib-devel
  478 + fi
  479 + f_pack_is_inst "libopenssl-devel" "zypper" "\"libopenssl-devel\" already installed!"
  480 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  481 + zypper --non-interactive install libopenssl-devel
  482 + fi
  483 + f_pack_is_inst "postgresql-devel" "zypper" "\"postgresql-devel\" already installed!"
  484 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  485 + zypper --non-interactive install postgresql-devel
  486 + fi
  487 + fi
  488 + fi
  489 + F_COM_PKS_INSTALLED=1
  490 + fi
  491 +}
  492 +
  493 +# < -----------------------------------------
  494 +
  495 +# > -----------------------------------------
224 496 # Instalar o python3.2!
225 497  
226 498 EZ_I_SKIP_ON_V=$SIMPLE_INST
227 499 f_open_section
228   -read -d '' TITLE_F <<"EOF"
229   -Install python3.2?
230   -EOF
231   -
232   -f_yes_no "$TITLE_F"
233   -TITLE_F=""
  500 +f_yes_no "Install python3.2?"
234 501 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
235 502 f_chk_by_path_hlp "$BASE_INST_DIR_V/py32" "d" "python3.2 already installed in \"$BASE_INST_DIR_V/py32\"!"
236 503 if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then
  504 + f_common_packs
237 505 cd "$SCRIPTDIR_V"
238 506 cd ./other-srcs-n-apps
239 507 tar -zxvf Python-3.2.2.tar.gz
... ... @@ -254,15 +522,11 @@ f_close_section
254 522  
255 523 EZ_I_SKIP_ON_V=$SIMPLE_INST
256 524 f_open_section
257   -read -d '' TITLE_F <<"EOF"
258   -Install virtualenv-1.11.6 on python3.2?
259   -EOF
260   -
261   -f_yes_no "$TITLE_F"
262   -TITLE_F=""
  525 +f_yes_no "Install virtualenv-1.11.6 on python3.2?"
263 526 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
264 527 f_chk_by_path_hlp "$BASE_INST_DIR_V/py32/bin/virtualenv-3.2" "f" "virtualenv-1.11.6 already installed in python3.2 (\"$BASE_INST_DIR_V/py32\")!"
265 528 if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then
  529 + f_common_packs
266 530 cd "$SCRIPTDIR_V"
267 531 cd ./other-srcs-n-apps
268 532 tar -zxvf virtualenv-1.11.6.tar.gz
... ... @@ -282,9 +546,25 @@ f_close_section
282 546 EZ_I_SKIP_ON_V=$SIMPLE_INST
283 547 f_open_section
284 548 f_enter_to_cont "Create the virtual environment (python3.2)!"
285   -
286 549 f_chk_by_path_hlp "$BASE_INST_DIR_V/ve32" "d" "Virtual environment (python3.2) already created in \"$BASE_INST_DIR_V/ve32\"!"
287 550 if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then
  551 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  552 + f_pack_is_inst "python-setuptools" "yum" "\"python-setuptools\" already installed!"
  553 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  554 + yum -y install python-setuptools
  555 + fi
  556 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  557 + f_pack_is_inst "python-setuptools" "apt-get" "\"python-setuptools\" already installed!"
  558 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  559 + apt-get -y install python-setuptools
  560 + fi
  561 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  562 + f_pack_is_inst "python-setuptools" "zypper" "\"python-setuptools\" already installed!"
  563 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  564 + zypper --non-interactive install python-setuptools
  565 + fi
  566 + fi
  567 + f_common_packs
288 568 cd "$BASE_INST_DIR_V"
289 569 $BASE_INST_DIR_V/py32/bin/virtualenv-3.2 ve32
290 570 mkdir "$BASE_INST_DIR_V/ve32/src"
... ... @@ -297,22 +577,57 @@ f_close_section
297 577 # > -----------------------------------------
298 578 # Instalar o Apache (httpd)!
299 579  
  580 +HTTPD_SERV_NAME=""
  581 +HTTPD_USR=""
  582 +HTTPD_GRP=""
  583 +HTTPD_DEF_DOC_ROOT=""
  584 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  585 + HTTPD_SERV_NAME="httpd"
  586 + HTTPD_USR="apache"
  587 + HTTPD_GRP="apache"
  588 + HTTPD_DEF_DOC_ROOT="/var/www"
  589 +elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  590 + HTTPD_SERV_NAME="apache2"
  591 + HTTPD_USR="www-data"
  592 + HTTPD_GRP="www-data"
  593 + HTTPD_DEF_DOC_ROOT="/var/www"
  594 +elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  595 + HTTPD_SERV_NAME="apache2"
  596 + HTTPD_USR="wwwrun"
  597 + HTTPD_GRP="www"
  598 + HTTPD_DEF_DOC_ROOT="/srv/www"
  599 +fi
  600 +
300 601 EZ_I_SKIP_ON_V=$SIMPLE_INST
301 602 f_open_section
302   -read -d '' TITLE_F <<"EOF"
303   -Install Apache (httpd)?
304   -EOF
305   -
306   -f_yes_no "$TITLE_F"
307   -TITLE_F=""
  603 +f_yes_no "Install Apache ($HTTPD_SERV_NAME)?"
308 604 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
309   - f_pack_is_inst "httpd-devel" "yum" "Apache (httpd) already installed!"
310   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
311   - yum -y install httpd-devel httpd
312   - chkconfig httpd on
313   - chown -R apache /var/www
314   - chmod -R 755 /var/www
  605 + f_common_packs
  606 +
  607 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  608 + f_pack_is_inst "httpd-devel" "yum" "Apache ($HTTPD_SERV_NAME) already installed!"
  609 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  610 + yum -y install httpd-devel httpd
  611 + chkconfig httpd on
  612 + fi
  613 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  614 + f_pack_is_inst "apache2-dev" "apt-get" "Apache ($HTTPD_SERV_NAME) already installed!"
  615 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  616 + apt-get -y install apache2-dev apache2
  617 + update-rc.d -f $HTTPD_SERV_NAME remove
  618 + update-rc.d $HTTPD_SERV_NAME defaults
  619 + fi
  620 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  621 + f_pack_is_inst "apache2-devel" "zypper" "Apache ($HTTPD_SERV_NAME) already installed!"
  622 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  623 + zypper --non-interactive install apache2-devel apache2
  624 + chkconfig apache2 on
  625 + fi
315 626 fi
  627 + eval "chown -R $HTTPD_USR $HTTPD_DEF_DOC_ROOT"
  628 + eval "chown -R :$HTTPD_GRP $HTTPD_DEF_DOC_ROOT"
  629 + eval "chmod -R 755 $HTTPD_DEF_DOC_ROOT"
  630 + eval "service $HTTPD_SERV_NAME restart" &>/dev/null
316 631 fi
317 632 f_close_section
318 633  
... ... @@ -321,48 +636,69 @@ f_close_section
321 636 # > -----------------------------------------
322 637 # Abrir o firewall para o Apache (httpd)!
323 638  
324   -EZ_I_SKIP_ON_V=$SIMPLE_INST
325   -f_open_section
326   -read -d '' TITLE_F <<"EOF"
327   -Open firewall for Apache (httpd) (TCP 80)?
328   -EOF
329   -
330   -f_yes_no "$TITLE_F"
331   -TITLE_F=""
332   -if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
333   - f_chk_iptables 80 "Port 80 is already open!" 0 "ACCEPT" "tcp" "NEW"
334   - if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
335   - iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
336   - service iptables save
337   - service iptables restart
  639 +if [[ "$DISTRO_TYPE" == "RH" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  640 + EZ_I_SKIP_ON_V=$SIMPLE_INST
  641 + f_open_section
  642 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  643 + f_yes_no "Open firewall for Apache ($HTTPD_SERV_NAME) (TCP 80)?"
  644 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  645 + f_chk_iptables 80 "Port 80 is already open!" 0 "ACCEPT" "tcp" "NEW"
  646 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  647 + iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
  648 + service iptables save
  649 + service iptables restart
  650 + fi
  651 + fi
  652 + f_close_section
  653 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  654 + f_yes_no "Open firewall for Apache ($HTTPD_SERV_NAME) (TCP 80)?"
  655 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  656 + f_chk_iptables 80 "Port 80 is already open!" 0 "ACCEPT" "tcp"
  657 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  658 + SuSEfirewall2 open EXT TCP 80
  659 + SuSEfirewall2 stop
  660 + SuSEfirewall2 start
  661 + fi
  662 + fi
338 663 fi
  664 + f_close_section
339 665 fi
340   -f_close_section
341 666  
342 667 # < -----------------------------------------
343 668  
344 669 # > -----------------------------------------
345 670 # Instalar o mod_wsgi-4.3.2!
346 671  
  672 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  673 + MOD_WSGI_PATH="/usr/lib64/httpd/modules/mod_wsgi.so"
  674 +elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  675 + MOD_WSGI_PATH="/usr/lib/apache2/modules/mod_wsgi.so"
  676 +elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  677 + MOD_WSGI_PATH="/usr/lib64/apache2/mod_wsgi.so"
  678 +fi
  679 +
347 680 EZ_I_SKIP_ON_V=$SIMPLE_INST
348 681 f_open_section
349   -read -d '' TITLE_F <<"EOF"
350   -Install mod_wsgi-4.3.2?
351   -EOF
352   -
353   -f_yes_no "$TITLE_F"
354   -TITLE_F=""
  682 +f_yes_no "Install mod_wsgi-4.3.2?"
355 683 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  684 + f_common_packs
  685 +
356 686 cd "$SCRIPTDIR_V"
357 687 cd ./other-srcs-n-apps
358 688  
  689 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  690 + REPLACE_REF="include ld.so.conf.d/*.conf"
  691 + elif [[ "$DISTRO_TYPE" == "DEB" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  692 + REPLACE_REF="include /etc/ld.so.conf.d/*.conf"
  693 + fi
  694 +
359 695 f_fl_cont_str "$BASE_INST_DIR_V/py32/lib" "/etc/ld.so.conf" "The file \"/etc/ld.so.conf\" probably has already been changed! Check it!"
360 696 if [ ${FL_CONT_STR_R} -eq 0 ] ; then
361   - f_ez_sed "include ld.so.conf.d/*.conf" "include ld.so.conf.d/*.conf\n$BASE_INST_DIR_V/py32/lib" "/etc/ld.so.conf"
  697 + f_ez_sed "$REPLACE_REF" "$REPLACE_REF\n$BASE_INST_DIR_V/py32/lib" "/etc/ld.so.conf"
362 698 fi
363 699  
364 700 UP_MOD_WSGI=1
365   - f_chk_by_path_hlp "/usr/lib64/httpd/modules/mod_wsgi.so" "f" "mod_wsgi already installed in \"/usr/lib64/httpd/modules/mod_wsgi.so\"!"
  701 + f_chk_by_path_hlp "$MOD_WSGI_PATH" "f" "mod_wsgi already installed in \"$MOD_WSGI_PATH\"!"
366 702 if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then
367 703 if [ ${EZ_I_SKIP_ON_V} -eq 0 ] ; then
368 704 TITLE_F="Update/reinstall mod_wsgi? (\"y\" recommended)"
... ... @@ -372,7 +708,7 @@ if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
372 708 TITLE_F=""
373 709 UP_MOD_WSGI=$YES_NO_R
374 710 if [ ${UP_MOD_WSGI} -eq 1 ] ; then
375   - rm -rf "/usr/lib64/httpd/modules/mod_wsgi.so"
  711 + rm -rf "$MOD_WSGI_PATH"
376 712 fi
377 713 fi
378 714 fi
... ... @@ -381,7 +717,8 @@ if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
381 717 tar -zxvf ./mod_wsgi-4.3.2.tar.gz
382 718 cd ./mod_wsgi-4.3.2
383 719 eval "./configure --with-python=$BASE_INST_DIR_V/py32/bin/python3.2"
384   - make && make install
  720 + make
  721 + make install
385 722 cd ..
386 723 rm -rf ./mod_wsgi-4.3.2
387 724 fi
... ... @@ -393,30 +730,51 @@ f_close_section
393 730 # > -----------------------------------------
394 731 # Instalar o ElasticSearch!
395 732  
  733 +ES_NAME="Elasticsearch 1.7.5"
  734 +ES_SERV_CMD="/etc/init.d/elasticsearch"
396 735 EZ_I_SKIP_ON_V=$SIMPLE_INST
397 736 f_open_section
398   -read -d '' TITLE_F <<"EOF"
399   -Install ElasticSearch?
400   -EOF
401   -
402   -f_yes_no "$TITLE_F"
403   -TITLE_F=""
  737 +f_yes_no "Install $ES_NAME?"
404 738 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
405   - f_pack_is_inst "elasticsearch.noarch" "yum" "ElasticSearch already installed!"
406   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
407   - f_pack_is_inst "java-1.7.0-openjdk" "yum" "java-1.7.0-openjdk already installed!"
408   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
409   - yum -y install java-1.7.0-openjdk
  739 + f_common_packs
  740 + f_chk_by_path_hlp "/usr/local/elasticsearch" "d" "\"elasticsearch-1.7.5.tar.gz\" already installed in \"/usr/local/elasticsearch\"!"
  741 + F_BAK_MD_R=1
  742 + if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then
  743 + f_ez_mv_bak "/usr/local/elasticsearch" "Backup old version and update/reinstall? (\"y\" recommended)"
  744 + if [ ${F_BAK_MD_R} -eq 1 ] ; then
  745 + $ES_SERV_CMD stop &>/dev/null
  746 + cd "$F_BAK_PATH_R"
  747 + cd ..
  748 + tar -cvvzf "$F_BAK_NAME_R.tar.gz" "./$F_BAK_NAME_R"
  749 + rm -rf "$F_BAK_PATH_R"
  750 + fi
  751 + fi
  752 + if [ ${F_BAK_MD_R} -eq 1 ] ; then
  753 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  754 + f_pack_is_inst "java-1.7.0-openjdk" "yum" "java-1.7.0-openjdk already installed!"
  755 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  756 + yum -y install java-1.7.0-openjdk
  757 + fi
  758 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  759 + f_pack_is_inst "openjdk-7-jdk" "apt-get" "\"openjdk-7-jdk\" already installed!"
  760 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  761 + apt-get -y install openjdk-7-jdk
  762 + fi
  763 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  764 + f_pack_is_inst "java-1_7_0-openjdk" "zypper" "\"java-1_7_0-openjdk\" already installed!"
  765 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  766 + zypper --non-interactive install java-1_7_0-openjdk
  767 + fi
410 768 fi
411 769 cd "$SCRIPTDIR_V"
412 770 cd ./other-srcs-n-apps
413   - rpm -Uvh elasticsearch-1.1.1.noarch.rpm
414   - /sbin/chkconfig --add elasticsearch
415   - f_fl_cont_str "cluster.name: lb" "/etc/elasticsearch/elasticsearch.yml" "The file \"/etc/elasticsearch/elasticsearch.yml\" probably has already been changed! Check it!"
416   - if [ ${FL_CONT_STR_R} -eq 0 ] ; then
417   - f_ez_sed "# cluster.name: elasticsearch" "# cluster.name: elasticsearch\ncluster.name: lb" "/etc/elasticsearch/elasticsearch.yml"
418   - fi
419   - service elasticsearch start
  771 + tar -zxvf elasticsearch-1.7.5.tar.gz
  772 + mv elasticsearch-1.7.5 /usr/local/elasticsearch
  773 + tar -zxvf elasticsearch-servicewrapper-master.tar.gz
  774 + mv elasticsearch-servicewrapper-master/service /usr/local/elasticsearch/bin/
  775 + rm -rf elasticsearch-servicewrapper-master
  776 + /usr/local/elasticsearch/bin/service/elasticsearch install
  777 + $ES_SERV_CMD start
420 778 fi
421 779 fi
422 780 f_close_section
... ... @@ -426,47 +784,102 @@ f_close_section
426 784 # > -----------------------------------------
427 785 # Abrir o firewall para o ElasticSearch!
428 786  
429   -EZ_I_SKIP_ON_V=$SIMPLE_INST
430   -f_open_section
431   -read -d '' TITLE_F <<"EOF"
432   -Open firewall for ElasticSearch (TCP 9200)?
433   -EOF
434   -
435   -f_yes_no "$TITLE_F"
436   -TITLE_F=""
437   -if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
438   - f_chk_iptables 9200 "Port 9200 is already open!" 0 "ACCEPT" "tcp" "NEW"
439   - if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
440   - iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT
441   - service iptables save
442   - service iptables restart
  787 +if [[ "$DISTRO_TYPE" == "RH" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  788 + EZ_I_SKIP_ON_V=$SIMPLE_INST
  789 + f_open_section
  790 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  791 + f_yes_no "Open firewall for $ES_NAME? (TCP 9200)?"
  792 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  793 + f_chk_iptables 9200 "Port 9200 is already open!" 0 "ACCEPT" "tcp" "NEW"
  794 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  795 + iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT
  796 + service iptables save
  797 + service iptables restart
  798 + fi
  799 + fi
  800 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  801 + f_yes_no "Open firewall for $ES_NAME? (TCP 9200)?"
  802 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  803 + f_chk_iptables 9200 "Port 9200 is already open!" 0 "ACCEPT" "tcp"
  804 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  805 + SuSEfirewall2 open EXT TCP 9200
  806 + SuSEfirewall2 stop
  807 + SuSEfirewall2 start
  808 + fi
  809 + fi
443 810 fi
  811 + f_close_section
444 812 fi
445   -f_close_section
446 813  
447 814 # < -----------------------------------------
448 815  
449 816 # > -----------------------------------------
450   -# Instalar o postgres 9.4!
451   -
  817 +# Instalar o postgresql!
  818 +
  819 +PG_NAME=""
  820 +PG_SERV_NAME=""
  821 +PG_PACK_NAME=""
  822 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  823 + PG_NAME="PostgreSQL 9.3"
  824 + PG_SERV_NAME="postgresql-9.3"
  825 + if [[ "$DISTRO_NAME" == "RedHat" ]] ; then
  826 + PG_PACK_NAME="pgdg-redhat93-9.3-2.noarch.rpm"
  827 + else
  828 + PG_PACK_NAME="pgdg-centos93-9.3-2.noarch.rpm"
  829 + fi
  830 +elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  831 + if [[ "$DISTRO_NAME" == "Debian" ]] ; then
  832 + PG_NAME="PostgreSQL 9.4"
  833 + PG_SERV_NAME="postgresql"
  834 + PG_PACK_NAME="postgresql-9.4"
  835 + else
  836 + PG_NAME="PostgreSQL 9.3"
  837 + PG_SERV_NAME="postgresql"
  838 + PG_PACK_NAME="postgresql-9.3"
  839 + fi
  840 +elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  841 + if [[ "$DISTRO_NAME" == "SLES" ]] ; then
  842 + PG_NAME="PostgreSQL 9.4"
  843 + PG_SERV_NAME="postgresql"
  844 + PG_PACK_NAME="postgresql94-server"
  845 + else
  846 + PG_NAME="PostgreSQL 9.3"
  847 + PG_SERV_NAME="postgresql"
  848 + PG_PACK_NAME="postgresql93-server"
  849 + fi
  850 +fi
452 851 EZ_I_SKIP_ON_V=$SIMPLE_INST
453 852 f_open_section
454   -read -d '' TITLE_F <<"EOF"
455   -Install postgres 9.4?
456   -EOF
457   -
458   -f_yes_no "$TITLE_F"
459   -TITLE_F=""
  853 +f_yes_no "Install $PG_NAME?"
460 854 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  855 + f_common_packs
  856 +
461 857 cd "$SCRIPTDIR_V"
462 858 cd ./other-srcs-n-apps
463   - f_pack_is_inst "pgdg-centos94-9.4-1.noarch" "yum" "postgres 9.4 already installed!"
464   - if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
465   - yum -y localinstall pgdg-centos94-9.4-1.noarch.rpm
466   - yum -y install postgresql94-server
467   - service postgresql-9.4 initdb
468   - chkconfig postgresql-9.4 on
469   - service postgresql-9.4 start
  859 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  860 + f_pack_is_inst "postgresql93-server" "yum" "\"postgresql93-server\" already installed!"
  861 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  862 + yum -y localinstall $PG_PACK_NAME
  863 + yum -y install postgresql93-server
  864 + service $PG_SERV_NAME initdb
  865 + chkconfig $PG_SERV_NAME on
  866 + service $PG_SERV_NAME start
  867 + fi
  868 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  869 + f_pack_is_inst "$PG_PACK_NAME" "apt-get" "\"$PG_PACK_NAME\" already installed!"
  870 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  871 + apt-get -y install $PG_PACK_NAME
  872 + update-rc.d -f $PG_SERV_NAME remove
  873 + update-rc.d $PG_SERV_NAME defaults
  874 + service $PG_SERV_NAME start
  875 + fi
  876 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  877 + f_pack_is_inst "$PG_PACK_NAME" "zypper" "\"$PG_PACK_NAME\" already installed!"
  878 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  879 + zypper --non-interactive install $PG_PACK_NAME
  880 + chkconfig $PG_SERV_NAME on
  881 + service $PG_SERV_NAME start
  882 + fi
470 883 fi
471 884 fi
472 885 f_close_section
... ... @@ -474,24 +887,78 @@ f_close_section
474 887 # < -----------------------------------------
475 888  
476 889 # > -----------------------------------------
477   -# Configurar o postgres 9.4!
  890 +# Abrir o firewall para o postgresql!
  891 +
  892 +if [[ "$DISTRO_TYPE" == "RH" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  893 + EZ_I_SKIP_ON_V=$SIMPLE_INST
  894 + f_open_section
  895 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  896 + f_yes_no "Open firewall for $PG_NAME (TCP 5432)?"
  897 + if [ ${YES_NO_R} -eq 1 ] ; then
  898 + f_chk_iptables 5432 "Port 5432 is already open!" 0 "ACCEPT" "tcp"
  899 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  900 + iptables -I INPUT 1 -m tcp -p tcp --dport 5432 -j ACCEPT
  901 + service iptables save
  902 + service iptables restart
  903 + fi
  904 + fi
  905 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  906 + f_yes_no "Open firewall for $PG_NAME (TCP 5432)?"
  907 + if [ ${YES_NO_R} -eq 1 ] ; then
  908 + f_chk_iptables 5432 "Port 5432 is already open!" 0 "ACCEPT" "tcp"
  909 + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
  910 + SuSEfirewall2 open EXT TCP 5432
  911 + SuSEfirewall2 stop
  912 + SuSEfirewall2 start
  913 + fi
  914 + fi
  915 + fi
  916 + f_close_section
  917 +fi
  918 +
  919 +# < -----------------------------------------
  920 +
  921 +# > -----------------------------------------
  922 +# Configurar o postgresql!
478 923  
479 924 CONF_PG=0
480 925 EZ_I_SKIP_ON_V=0
481 926 f_open_section
482   -TITLE_F="Configure postgres 9.4 (use \"y\" if you never did it)?"
483   -f_yes_no "$TITLE_F"
484   -TITLE_F=""
  927 +f_yes_no "Configure $PG_NAME (use \"y\" if you never did it)?"
485 928 PG_USER_F="lbu"
486 929 PG_PWD_F="lbu"
487 930 PG_EXT_ACS_F=""
488   -if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
  931 +
  932 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  933 + PG_HBA_PATH="/var/lib/pgsql/9.3/data/pg_hba.conf"
  934 + PG_CONF_PATH="/var/lib/pgsql/9.3/data/postgresql.conf"
  935 +elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  936 + if [[ "$DISTRO_NAME" == "Debian" ]] ; then
  937 + PG_HBA_PATH="/etc/postgresql/9.4/main/pg_hba.conf"
  938 + PG_CONF_PATH="/etc/postgresql/9.4/main/postgresql.conf"
  939 + else
  940 + PG_HBA_PATH="/etc/postgresql/9.3/main/pg_hba.conf"
  941 + PG_CONF_PATH="/etc/postgresql/9.3/main/postgresql.conf"
  942 + fi
  943 +elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  944 + PG_HBA_PATH="/var/lib/pgsql/data/pg_hba.conf"
  945 + PG_CONF_PATH="/var/lib/pgsql/data/postgresql.conf"
  946 +fi
  947 +
  948 +if [ ${YES_NO_R} -eq 1 ] ; then
489 949  
490 950 EZ_I_SKIP_ON_V=$SIMPLE_INST
491 951  
  952 + if [[ "$DISTRO_TYPE" == "DEB" ]] && [[ "$DISTRO_NAME" == "Debian" ]] ; then
  953 + f_pack_is_inst "sudo" "apt-get" "\"sudo\" already installed!"
  954 + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then
  955 + apt-get -y install sudo
  956 + fi
  957 + fi
  958 +
492 959 f_div_section
493 960  
494   - QUESTION_F="Enter the postgres 9.4 user for lightbase (LBG).
  961 + QUESTION_F="Enter the $PG_NAME user for lightbase (LBG).
495 962 Use empty for \"$PG_USER_F\"!"
496 963  
497 964 f_get_usr_input "$QUESTION_F" 1
... ... @@ -502,7 +969,7 @@ Use empty for \&quot;$PG_USER_F\&quot;!&quot;
502 969  
503 970 f_div_section
504 971  
505   - QUESTION_F="Enter the postgres 9.4 password for \"$PG_USER_F\".
  972 + QUESTION_F="Enter the $PG_NAME password for \"$PG_USER_F\".
506 973 Use empty for \"$PG_PWD_F\"!"
507 974  
508 975 f_get_usr_input "$QUESTION_F" 1
... ... @@ -524,6 +991,8 @@ Use empty for local access only!&quot;
524 991 fi
525 992 EZ_I_SKIP_ON_V=0
526 993  
  994 + service $PG_SERV_NAME start &>/dev/null
  995 +
527 996 f_is_not_running "postgres" "ERROR! \"postgres\" service not running!"
528 997 if [ ${F_IS_NOT_RUNNING_R} -eq 0 ] ; then
529 998 cd /tmp
... ... @@ -562,77 +1031,53 @@ Use empty for local access only!&quot;
562 1031 f_error_exit
563 1032 fi
564 1033 fi
565   - cd - >/dev/null
  1034 + cd - &>/dev/null
566 1035 else
567 1036 f_error_exit
568 1037 fi
569 1038  
570 1039 EZ_I_SKIP_ON_V=$SIMPLE_INST
571 1040 if [ -n "$PG_EXT_ACS_F" ] ; then
572   - f_fl_cont_str "host all all $PG_EXT_ACS_F trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" probably has already been changed for external access! Check it!"
  1041 + f_fl_cont_str "host all all $PG_EXT_ACS_F trust" "$PG_HBA_PATH" "The file \"$PG_HBA_PATH\" probably has already been changed to enable external access! Check it!"
573 1042 if [ ${FL_CONT_STR_R} -eq 0 ] ; then
574   - f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all $PG_EXT_ACS_F trust" "/var/lib/pgsql/9.4/data/pg_hba.conf"
  1043 + f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all $PG_EXT_ACS_F trust" "$PG_HBA_PATH"
575 1044 fi
576 1045 fi
577 1046  
578   - f_fl_cont_str "host all all 127.0.0.1/32 trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" probably has already been changed for local access! Check it!"
  1047 + f_fl_cont_str "host all all 127.0.0.1/32 trust" "$PG_HBA_PATH" "The file \"$PG_HBA_PATH\" probably has already been changed to enable local access! Check it!"
579 1048 if [ ${FL_CONT_STR_R} -eq 0 ] ; then
580   - f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all 127.0.0.1/32 trust" "/var/lib/pgsql/9.4/data/pg_hba.conf"
  1049 + f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all 127.0.0.1/32 trust" "$PG_HBA_PATH"
581 1050 fi
582 1051  
583   - f_fl_cont_str "listen_addresses = '*'" "/var/lib/pgsql/9.4/data/postgresql.conf" "The file \"/var/lib/pgsql/9.4/data/postgresql.conf\" probably has already been changed! Check it!"
  1052 + f_fl_cont_str "listen_addresses = '*'" "$PG_CONF_PATH" "The file \"$PG_CONF_PATH\" probably has already been changed to set \"listen addresses\"! Check it!"
584 1053 if [ ${FL_CONT_STR_R} -eq 0 ] ; then
585   - f_ez_sed "# - Connection Settings -" "# - Connection Settings -\n\nlisten_addresses = '*'" "/var/lib/pgsql/9.4/data/postgresql.conf"
  1054 + f_ez_sed "# - Connection Settings -" "# - Connection Settings -\n\nlisten_addresses = '*'" "$PG_CONF_PATH"
586 1055 fi
587 1056  
588   - service postgresql-9.4 restart
589   - f_enter_to_cont "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" has settings for postgres 9.4! Check it for more details!"
  1057 + service $PG_SERV_NAME restart
  1058 +
  1059 + f_enter_to_cont "The file \"$PG_HBA_PATH\" has settings for $PG_NAME! Check it for more details!"
590 1060 EZ_I_SKIP_ON_V=0
591 1061 CONF_PG=1
592 1062 else
593   - f_enter_to_cont "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" has settings for postgres 9.4! Check it!"
594   -fi
595   -f_close_section
596   -
597   -# < -----------------------------------------
598   -
599   -# > -----------------------------------------
600   -# Abrir o firewall para o postgres 9.4!
601   -
602   -EZ_I_SKIP_ON_V=0
603   -f_open_section
604   -read -d '' TITLE_F <<"EOF"
605   -Open firewall for postgres 9.4 (TCP 5432)?
606   -EOF
607   -
608   -f_yes_no "$TITLE_F"
609   -TITLE_F=""
610   -if [ ${YES_NO_R} -eq 1 ] ; then
611   - f_chk_iptables 5432 "Port 5432 is already open!" 0 "ACCEPT" "tcp"
612   - if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then
613   - iptables -I INPUT 1 -m tcp -p tcp --dport 5432 -j ACCEPT
614   - service iptables save
615   - service iptables restart
616   - fi
  1063 + f_enter_to_cont "The file \"$PG_HBA_PATH\" has settings for $PG_NAME! Check it!"
617 1064 fi
618 1065 f_close_section
619 1066  
620 1067 # < -----------------------------------------
621 1068  
622 1069 # > -----------------------------------------
623   -# Criar as estruturas de dados básicas do LB no postgres 9.4!
  1070 +# Criar as estruturas de dados básicas do LB no postgresql!
624 1071  
625 1072 CREATE_LB_DT=0
626 1073 EZ_I_SKIP_ON_V=0
627 1074 f_open_section
628   -TITLE_F="Create the basic LightBase (LBG) data structures in postgres 9.4 (use \"y\" if you never did it)?"
629   -f_yes_no "$TITLE_F"
630   -TITLE_F=""
  1075 +f_yes_no "Create the basic LightBase (LBG) data structures in $PG_NAME (use \"y\" if you never did it)?"
631 1076 PG_DB_F="lb"
632 1077 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
633 1078  
634 1079 EZ_I_SKIP_ON_V=$SIMPLE_INST
635   - QUESTION_F="Enter the postgres 9.4 database name for LightBase (LBG).
  1080 + QUESTION_F="Enter the $PG_NAME database name for LightBase (LBG).
636 1081 Use empty for \"$PG_DB_F\" (recommended)!"
637 1082  
638 1083 f_get_usr_input "$QUESTION_F" 1
... ... @@ -642,6 +1087,7 @@ Use empty for \&quot;$PG_DB_F\&quot; (recommended)!&quot;
642 1087 fi
643 1088 EZ_I_SKIP_ON_V=0
644 1089 f_is_not_running "postgres" "ERROR! \"postgres\" service not running!"
  1090 +
645 1091 if [ ${F_IS_NOT_RUNNING_R} -eq 0 ] ; then
646 1092 cd /tmp
647 1093 f_get_stderr_stdout "sudo -u postgres psql -c \"CREATE DATABASE $PG_DB_F;\""
... ... @@ -682,7 +1128,7 @@ f_close_section
682 1128  
683 1129 EZ_I_SKIP_ON_V=$SIMPLE_INST
684 1130 cd "$SCRIPTDIR_V"
685   -sh py-packs-liblightbase.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V"
  1131 +bash py-packs-liblightbase.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V"
686 1132  
687 1133 # < -----------------------------------------
688 1134  
... ... @@ -720,22 +1166,23 @@ f_close_section
720 1166  
721 1167 EZ_I_SKIP_ON_V=$SIMPLE_INST
722 1168 cd "$SCRIPTDIR_V"
723   -sh py-packs-LBGenerator.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V"
  1169 +bash py-packs-LBGenerator.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V"
724 1170  
725 1171 # < -----------------------------------------
726 1172  
727 1173 # > -----------------------------------------
728 1174 # Instalar o LBG - LBGenerator!
729 1175  
  1176 +if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  1177 + VAR_LOG_HTTPD="/var/log/httpd"
  1178 +elif [[ "$DISTRO_TYPE" == "DEB" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  1179 + VAR_LOG_HTTPD="/var/log/apache2"
  1180 +fi
  1181 +
730 1182 EZ_I_SKIP_ON_V=$SIMPLE_INST
731 1183 APP_URL_F="lbg"
732 1184 f_open_section
733   -read -d '' TITLE_F <<"EOF"
734   -Install the LBG - LBGenerator?
735   -EOF
736   -
737   -f_yes_no "$TITLE_F"
738   -TITLE_F=""
  1185 +f_yes_no "Install the LBG - LBGenerator?"
739 1186 if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
740 1187  
741 1188 f_chk_by_path_hlp "$BASE_INST_DIR_V/ve32/src/LBGenerator" "d" "\"LBGenerator\" already installed in \"$BASE_INST_DIR_V/ve32/src\"!"
... ... @@ -750,14 +1197,10 @@ if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then
750 1197 cd "$BASE_INST_DIR_V/ve32/src/LBGenerator"
751 1198 eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install"
752 1199  
753   - f_enter_to_cont "Configure httpd (Apache) for LBG - LBGenerator!"
  1200 + f_enter_to_cont "Configure Apache ($HTTPD_SERV_NAME) for LBG - LBGenerator!"
754 1201  
755   - # NOTE: To debug! By Questor
756   - # PG_USER_F="lbu"
757   - # PG_PWD_F="lbu"
758   - # PG_DB_F="lb"
759 1202 PG_CFG_F="postgresql://$PG_USER_F:$PG_PWD_F@127.0.0.1/$PG_DB_F"
760   - QUESTION_F="Enter the postgres 9.4 LBG configuration.
  1203 + QUESTION_F="Enter the postgresql LBG configuration.
761 1204 Use empty for \"$PG_CFG_F\"!"
762 1205  
763 1206 f_div_section
... ... @@ -784,22 +1227,44 @@ Use empty for \&quot;$APP_URL_F\&quot; (used like e.g. http://&lt;ip_or_name&gt;/$APP_URL_F)!&quot;
784 1227 eval "cp -f \"$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini-dist\" \"$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini\""
785 1228 f_ez_sed "<SQLALCHEMY_URL>" "$PG_CFG_F" "$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini" 1
786 1229  
787   - f_chk_by_path_hlp "/etc/httpd/conf.d/lbg.conf" "f" "\"lbg.conf\" already created in \"/etc/httpd/conf.d/lbg.conf\"!"
  1230 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  1231 + HTTPD_CONF_PATH="/etc/httpd/conf.d"
  1232 + elif [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  1233 + HTTPD_CONF_PATH="/etc/apache2/sites-available"
  1234 + elif [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  1235 + HTTPD_CONF_PATH="/etc/apache2/conf.d"
  1236 + fi
  1237 +
  1238 + f_chk_by_path_hlp "$HTTPD_CONF_PATH/lbg.conf" "f" "\"lbg.conf\" already created in \"$HTTPD_CONF_PATH/lbg.conf\"!"
788 1239 F_BAK_MD_R=1
789 1240 if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then
790   - f_ez_mv_bak "/etc/httpd/conf.d/lbg.conf" "Backup old version and update? (\"y\" recommended)"
  1241 + f_ez_mv_bak "$HTTPD_CONF_PATH/lbg.conf" "Backup old version and update? (\"y\" recommended)"
791 1242 fi
792 1243  
793 1244 if [ ${F_BAK_MD_R} -eq 1 ] ; then
794   - eval "cp -f \"$SCRIPTDIR_V/other-srcs-n-apps/lbg.conf.dist\" \"/etc/httpd/conf.d/lbg.conf\""
795   - f_ez_sed "<VE32_PATH>" "$BASE_INST_DIR_V/ve32" "/etc/httpd/conf.d/lbg.conf" 1
796   - f_ez_sed "<LBG_URL>" "$APP_URL_F" "/etc/httpd/conf.d/lbg.conf" 1
  1245 + eval "cp -f \"$SCRIPTDIR_V/other-srcs-n-apps/lbg.conf.dist\" \"$HTTPD_CONF_PATH/lbg.conf\""
  1246 + f_ez_sed "<MOD_WSGI_PATH>" "$MOD_WSGI_PATH" "$HTTPD_CONF_PATH/lbg.conf"
  1247 + f_ez_sed "<VE32_PATH>" "$BASE_INST_DIR_V/ve32" "$HTTPD_CONF_PATH/lbg.conf" 1
  1248 + f_ez_sed "<LBG_URL>" "$APP_URL_F" "$HTTPD_CONF_PATH/lbg.conf" 1
  1249 + f_ez_sed "<VAR_LOG_HTTPD>" "$VAR_LOG_HTTPD" "$HTTPD_CONF_PATH/lbg.conf" 1
  1250 + f_ez_sed "<HTTPD_USR>" "$HTTPD_USR" "$HTTPD_CONF_PATH/lbg.conf" 1
  1251 + f_ez_sed "<HTTPD_GRP>" "$HTTPD_GRP" "$HTTPD_CONF_PATH/lbg.conf" 1
  1252 + if [[ "$DISTRO_TYPE" == "RH" ]] ; then
  1253 + f_ez_sed "<DIR_RULES>" "Order allow,deny\n Allow from all" "$HTTPD_CONF_PATH/lbg.conf"
  1254 + elif [[ "$DISTRO_TYPE" == "DEB" ]] || [[ "$DISTRO_TYPE" == "SUSE" ]] ; then
  1255 + f_ez_sed "<DIR_RULES>" "AllowOverride None\n Require all granted " "$HTTPD_CONF_PATH/lbg.conf"
  1256 + fi
797 1257 fi
798 1258  
799   - eval "chown -R apache $BASE_INST_DIR_V"
  1259 + if [[ "$DISTRO_TYPE" == "DEB" ]] ; then
  1260 + ln -s "$HTTPD_CONF_PATH/lbg.conf" "/etc/apache2/sites-enabled/lbg.conf" &>/dev/null
  1261 + fi
  1262 +
  1263 + eval "chown -R $HTTPD_USR $BASE_INST_DIR_V"
  1264 + eval "chown -R :$HTTPD_GRP $BASE_INST_DIR_V"
800 1265 eval "chmod -R 755 $BASE_INST_DIR_V"
  1266 + eval "service $HTTPD_SERV_NAME restart" &>/dev/null
801 1267  
802   - service httpd restart
803 1268 fi
804 1269 fi
805 1270 f_close_section
... ... @@ -832,13 +1297,23 @@ if [ ${SIMPLE_INST} -eq 1 ] &amp;&amp; ([ ${CONF_PG} -eq 1 ] || [ ${CREATE_LB_DT} -eq 1
832 1297 fi
833 1298  
834 1299 PERSIST_CONFIG="
835   - LightBase (LBG) postgres 9.4 persistence config...$CREATE_LB_DT_VL$CONF_PG_VL
  1300 + LightBase (LBG) $PG_NAME persistence config...$CREATE_LB_DT_VL$CONF_PG_VL
836 1301 "
837 1302 fi
838 1303  
839 1304 USEFUL_INFO_F=" To start/stop...
840   - service httpd start
841   - service httpd stop
  1305 +
  1306 + Apache ($HTTPD_SERV_NAME)
  1307 + service $HTTPD_SERV_NAME start
  1308 + service $HTTPD_SERV_NAME stop
  1309 +
  1310 + $PG_NAME
  1311 + service $PG_SERV_NAME start
  1312 + service $PG_SERV_NAME stop
  1313 +
  1314 + $ES_NAME
  1315 + $ES_SERV_CMD start
  1316 + $ES_SERV_CMD stop
842 1317 $PERSIST_CONFIG
843 1318 To access...
844 1319 http://<ip>/$APP_URL_F
... ... @@ -847,10 +1322,10 @@ $PERSIST_CONFIG
847 1322 vi $BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini
848 1323  
849 1324 To configure httpd (Apache)...
850   - vi /etc/httpd/conf.d/lbg.conf
  1325 + vi $HTTPD_CONF_PATH/lbg.conf
851 1326  
852 1327 Log...
853   - less /var/log/httpd/error_log"
  1328 + less $VAR_LOG_HTTPD/error_log"
854 1329  
855 1330 f_end "$TITLE_F" "$USEFUL_INFO_F"
856 1331 TITLE_F=""
... ...
other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm
No preview for this file type
other-srcs-n-apps/elasticsearch-1.7.5.tar.gz 0 → 100755
No preview for this file type
other-srcs-n-apps/elasticsearch-servicewrapper-master.tar.gz 0 → 100755
No preview for this file type
other-srcs-n-apps/lbg.conf.dist
1 1 # Use only 1 Python sub-interpreter. Multiple sub-interpreters
2 2 # play badly with C extensions.
3 3  
4   -LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so
  4 +LoadModule wsgi_module <MOD_WSGI_PATH>
5 5  
6 6 WSGISocketPrefix /var/run/wsgi
7 7  
... ... @@ -10,14 +10,13 @@ ServerName 127.0.0.1
10 10  
11 11 WSGIApplicationGroup %{GLOBAL}
12 12 WSGIPassAuthorization On
13   -WSGIDaemonProcess <LBG_URL> user=apache group=apache threads=8 python-path=<VE32_PATH>/lib/python3.2/site-packages
  13 +WSGIDaemonProcess <LBG_URL> user=<HTTPD_USR> group=<HTTPD_GRP> threads=8 python-path=<VE32_PATH>/lib/python3.2/site-packages
14 14 WSGIScriptAlias /<LBG_URL> <VE32_PATH>/src/LBGenerator/lbgenerator.wsgi
15 15  
16 16 <Directory <VE32_PATH>>
17 17 WSGIProcessGroup <LBG_URL>
18   - Order allow,deny
19   - Allow from all
  18 + <DIR_RULES>
20 19 </Directory>
21 20  
22   -ErrorLog /var/log/httpd/neo-lightbase-error.log
23   -CustomLog /var/log/httpd/neo-lightbase-access.log combined
  21 +ErrorLog <VAR_LOG_HTTPD>/neo-lightbase-error.log
  22 +CustomLog <VAR_LOG_HTTPD>/neo-lightbase-access.log combined
... ...
other-srcs-n-apps/pgdg-centos93-9.3-2.noarch.rpm 0 → 100755
No preview for this file type
other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm
No preview for this file type
other-srcs-n-apps/pgdg-redhat93-9.3-2.noarch.rpm 0 → 100755
No preview for this file type