#!/bin/sh set -eu cache_dir="${RESIN_CACHE_DIR:-/var/cache/resin}" state_dir="${RESIN_STATE_DIR:-/var/lib/resin}" log_dir="${RESIN_LOG_DIR:-/var/log/resin}" if [ "$#" -eq 0 ]; then set -- /usr/local/bin/resin fi require_writable_dir() { dir="$1" label="$2" if [ ! -d "$dir" ]; then mkdir -p "$dir" fi if [ ! -w "$dir" ]; then cat >&2 <