#!/bin/bash # Copyright 2015 Jelastic, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. [ -f "/etc/jelastic/jelastic.conf" ] && { source "/etc/jelastic/jelastic.conf"; } platformVersion=$( sed -re 's/([0-9]).([0-9]).*/\1\2/' <<< ${PLATFORM_VERSION}) [ -n "${platformVersion}" ] && [ ${platformVersion} -ge 51 ] && return 0; function doList(){ ExtendPerm ; checkUser ; local result_code=$?; if [ "$result_code" -gt 0 ] ; then return $result_code; fi if [ -z "$FS_PATH" ]; then writeJSONResponseErr "result=>4033" "message=>Path not defined"; return 33; fi if ! dirExists "$FS_PATH"; then if ! fileExists "$FS_PATH"; then writeJSONResponseErr "result=>4035" "message=>Path '$FS_PATH' not exists"; return 35; else writeJSONResponseErr "result=>4102" "message=>'$FS_PATH' is not directory"; return 35; fi fi su - $FS_USER -c "$JFINFO $(printf '%q' "${FS_PATH}") 2>/dev/null" 2>>${JEM_CALLS_LOG} | sed -e 's/[^{]*//' -e '/^$/d'; }