Sha256: 5872a5dc329201f54e65f11d720e015735e82fa70a38f8a98bb777d34bc474e0

Contents?: true

Size: 590 Bytes

Versions: 1

Compression:

Stored size: 590 Bytes

Contents

#   source ./tmp/test_env
resource=$1
action=$2
start=$3

if [ -z "$MS_LOGIN" ] || [ -z "$MS_PASSWORD" ]; then
  echo "Утсановите переменные окружения MS_LOGIN и MS_PASSWORD"
  exit 1
fi

if [ -z "$resource" ]; then
  echo "Запуск: rest.sh Resoruce [action]"
  echo "Например: rest.sh Feature list"
  exit 2
fi

t=MS_TYPE || 'ms'

url="https://online.moysklad.ru/exchange/rest/$type/xml/$1/$2"

if [ "$action"=="list" ] && [ -n "$start" ]; then
  url="$url?start=$start"
fi

echo $url >&2
curl --max-redirs 3 -is -u $MS_LOGIN:$MS_PASSWORD $url

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
moysklad-0.1.2 scripts/rest.sh