Commit 267de902beae1f8edc8f055b8c7d79d088b1d057

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

Identificação do repositório RedHat qdo estiver usando "Satellite"! By Questor

Showing 1 changed file with 38 additions and 6 deletions   Show diff stats
ez_i.sh
... ... @@ -901,7 +901,6 @@ f_chk_distro_status() {
901 901 DISTRO_NAME_P=$1
902 902 RESOURCES_ARR_P=("${!2}")
903 903 TOTAL_2=${#RESOURCES_ARR_P[*]}
904   -
905 904 RES_OK_ARR=()
906 905 REDHAT_ACTV=0
907 906  
... ... @@ -909,11 +908,42 @@ f_chk_distro_status() {
909 908 if [ "$DISTRO_NAME_P" == "RedHat" ] ; then
910 909 CHK_RES_CMD="subscription-manager list --consumed"
911 910 f_get_stderr_stdout "$CHK_RES_CMD"
912   - f_split "$F_GET_STDOUT_R" "Subscription Name:"
  911 + F_CHK_DISTRO_STATUS_R=$F_GET_STDOUT_R
  912 +
  913 + # NOTE: To debug! By Questor
  914 +# F_GET_STDOUT_R="No consumed subscription pools to list
  915 +# "
  916 +
  917 + if [[ $F_GET_STDOUT_R == *"No consumed subscription pools to list"* ]] ; then
  918 + f_get_stderr_stdout "yum repolist"
  919 + F_CHK_DISTRO_STATUS_R=$F_GET_STDOUT_R
  920 +
  921 + # NOTE: To debug! By Questor
  922 +# F_GET_STDOUT_R="Loaded plugins: product-id, rhnplugin, security, subscription-manager
  923 +# This system is receiving updates from RHN Classic or RHN Satellite.
  924 +# repo id repo name status
  925 +# epel Extra Packages for Enterprise Linux 6 12125
  926 +# rhel-x86_64-server-6 Red Hat Enterprise Linux Server (v. 6 14725
  927 +# rhel-x86_64-server-optional-6 RHEL Server Optional (v. 6 64-bit x86_ 8257
  928 +# rhel-x86_64-server-supplementary-6 RHEL Server Supplementary (v. 6 64-bit 483
  929 +# repolist: 35590
  930 +# "
  931 +
  932 + if [[ $F_GET_STDOUT_R == *"RHN Classic or RHN Satellite"* ]] ; then
  933 + WAR_MSGS_STR="REDHAT IS APPARENTLY USING \"RHN Classic\" OR \"RHN Satellite\" TO ACCESS ITS RESOURCES!
  934 +THIS INSTALLER WILL NOT VALIDATE THESE RESOURCES!"
  935 + WAR_MSGS_STR+=$'\n\n'"FOR MORE INFORMATION TRY: \"yum repolist\"."
  936 + f_warning_msg "$WAR_MSGS_STR" 1
  937 + return 0
  938 + fi
  939 + else
  940 + f_split "$F_GET_STDOUT_R" "Subscription Name:"
  941 + fi
913 942 elif [ "$DISTRO_NAME_P" == "SLES" ] ; then
914 943 CHK_RES_CMD="zypper sl"
915 944 f_get_stderr_stdout "$CHK_RES_CMD"
916 945 f_split "$F_GET_STDOUT_R" "\n"
  946 + F_CHK_DISTRO_STATUS_R=$F_GET_STDOUT_R
917 947 fi
918 948  
919 949 F_SPLIT_R_0=("${F_SPLIT_R[@]}")
... ... @@ -978,12 +1008,13 @@ f_chk_distro_status() {
978 1008 WAR_MSGS_STR=""
979 1009 USE_NEWLINE=""
980 1010 if [ ! $TOTAL_4 -eq 0 ] || [ $REDHAT_ACTV -eq 0 ]; then
981   - WAR_MSGS_STR="SOME PROBLEM APPEAR TO HAVE BEEN DETECTED ON "
  1011 + WAR_MSGS_STR="SOME PROBLEM APPEAR TO HAVE BEEN DETECTED ON"
982 1012 if [[ "$DISTRO_NAME_P" == "RedHat" ]] ; then
983   - WAR_MSGS_STR+="REDHAT SUBSCRIPTION!"
  1013 + WAR_MSGS_STR+=" REDHAT SUBSCRIPTION! "
984 1014 elif [[ "$DISTRO_NAME_P" == "SLES" ]] ; then
985   - WAR_MSGS_STR+="SLES REGISTRATION!"
  1015 + WAR_MSGS_STR+=" SLES REGISTRATION! "
986 1016 fi
  1017 + WAR_MSGS_STR+="PLEASE CHECK IT!"
987 1018 for (( y=0; y<=$(( $TOTAL_4 -1 )); y++ )) ; do
988 1019 if (( $y == 0 )); then
989 1020 WAR_MSGS_STR+=$'\n\n'
... ... @@ -995,9 +1026,10 @@ f_chk_distro_status() {
995 1026 WAR_MSGS_STR+=$'\n\n'"FOR MORE INFORMATION TRY: \"$CHK_RES_CMD\"."
996 1027 f_warning_msg "$WAR_MSGS_STR" 1
997 1028 fi
998   - F_CHK_DISTRO_STATUS_R=$F_GET_STDOUT_R
999 1029 }
1000 1030  
  1031 +# < --------------------------------------------------------------------------
  1032 +
1001 1033 # > --------------------------------------------------------------------------
1002 1034 # GRAFICO!
1003 1035 # --------------------------------------
... ...