~ibmcharmers/charms/trusty/ibm-mobilefirst-server/trunk

« back to all changes in this revision

Viewing changes to reactive/ibm-im.sh

  • Committer: Suchitra Venugopal
  • Date: 2017-03-03 10:32:15 UTC
  • Revision ID: suchvenu@in.ibm.com-20170303103215-26ihfwfx9vucorr2
Review comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
@when_not 'ibm-im.installed'
11
11
function install_ibm_im(){
12
12
      # Fail fast if we're on an unsupported arch
13
 
      if [ "$ARCHITECTURE" != "x86_64" -a  "$ARCHITECTURE" != "ppc64le" ]; then
14
 
            juju-log "IBM IM: only supported on x86_64 or ppc64le platforms"
 
13
      if [ "$ARCHITECTURE" != "x86_64" -a  "$ARCHITECTURE" != "ppc64le" -a "$ARCHITECTURE" != "s390x" ]; then
 
14
            juju-log "IBM IM: only supported on x86_64 or ppc64le or s390x platforms"
15
15
            status-set blocked "unsupported architecture"
16
 
            exit 1
 
16
            return 1
17
17
      fi
18
18
 
19
19
      # Get the installable resource
25
25
      if [ "$cfg_im_pkg_name" = "unavailable" ]; then
26
26
        juju-log "IBM IM: missing required ibm_im_installer resource"
27
27
        status-set blocked "missing required ibm_im_installer resource"
28
 
        exit 0
 
28
        return 0
29
29
      fi
30
30
 
31
31
      juju-log "IBM IM: using $cfg_im_pkg_name as the ibm_im_installer resource"
44
44
                      # Remove corrupt archive file
45
45
                      status-set blocked "ibm_im_installer resource is corrupt"
46
46
                      rm -rf $ARCHIVE_DIR
47
 
                      exit 0
 
47
                      return 0
48
48
                 else
49
49
                      juju-log "IBM IM: ibm_im_installer resource extracted successfully"
50
50
                 fi
62
62
            status-set active "ready"
63
63
        else
64
64
            juju-log "IBM IM: error while installing"
65
 
            exit 1
 
65
            return 1
66
66
        fi
67
67
      else
68
68
        juju-log "IBM IM: installer was not found."
69
69
        status-set blocked "installation failed"
70
 
        exit 1
 
70
        return 1
71
71
      fi
72
72
}
73
73
 
83
83
    if [ "$ibm_im_fp_package" = "unavailable" ]; then
84
84
      juju-log "IBM IM: no ibm_im_fixpack to install"
85
85
      status-set active "ready"
86
 
      exit 0
 
86
      return 0
87
87
    fi
88
88
 
89
89
    # Currently, there is no way to make a resource optional, so something
95
95
    if [ "$ibm_im_fp_empty" = "True" ]; then
96
96
      juju-log "IBM IM: no ibm_im_fixpack to install"
97
97
      status-set active "ready"
98
 
      exit 0
 
98
      return 0
99
99
    fi
100
100
 
101
101
    juju-log "IBM IM: using $ibm_im_fp_package as the ibm_im_fixpack resource"
114
114
                      # Remove corrupt archive file
115
115
                      status-set blocked "ibm_im_fixpack resource is corrupt"
116
116
                      rm  -rf $ARCHIVE_DIR
117
 
                      exit 0
 
117
                      return 0
118
118
              else
119
119
                      juju-log "IBM IM: ibm_im_fixpack resource extracted successfully"
120
120
              fi
132
132
             status-set active "ready"
133
133
        else
134
134
             juju-log "IBM IM: error while installing the fixpack."
135
 
             exit 1
 
135
             return 1
136
136
        fi
137
137
    else
138
138
        juju-log "IBM_IM: Fix pack installer was not found."
139
139
        status-set blocked "fixpack installation failed"
140
 
        exit 1
 
140
        return 1
141
141
   fi
142
142
}
143
143
 
150
150
        # If there is no prior fixpack installed (because ibm-im.updated is not
151
151
        # set), do nothing since install-ibm-im-fixpack will handle that case.
152
152
        juju-log "IBM IM: no fixpack has been installed; nothing to upgrade."
153
 
        exit 0
 
153
        return 0
154
154
    else
155
155
        # If we have a fixpack already (because ibm-im.updated is set),
156
156
        # we should fetch the latest fixpack and determine if it is new.