#!/bin/bash

RES_NAME="upload-resource"
RES_PATH=$(2>&1 resource-get $RES_NAME)
if [ $? -ne 0 ]; then
    RES_GET_STDERR=$RES_PATH
    status-set blocked "[resource "'"'"$RES_NAME"'"'"] $RES_GET_STDERR"
    exit 0
fi

set -e

status-set maintenance "path: $RES_PATH"
status-set maintenance $(cat $RES_PATH)
