-#!/bin/zsh
+#!/bin/sh
# Copyright 2016 - 2018 Paul Hänsch
#
}
FILE(){
- unset range file_size file_date http_date cachedate
+ local file file_size file_date http_date cachedate range
file="$1"
if ! [ -f "$file" ]; then
[ "$REQUEST_METHOD" != HEAD ] \
&& tail -c+$((${range%-*} + 1)) "$file" \
- | head -c "$((${range#*-} - ${range%-*} + 1))"
+ | head -c "$((${range#*-} - ${range%-*} + 1))"
elif [ "${range%-*}" -gt "${range#*-}" ]; then
printf '%s: %s\r\n' \
include_storage="$0"
LOCK(){
+ local lock timeout block
lock="${1}.lock"
timeout="${2-20}"
if [ \! -w "${lock%/*}" ] || [ -e "$lock" -a \! -d "$lock" ]; then
}
RELEASE(){
+ local lock
lock="${1}.lock"
if [ "$(cat "$lock/pid")" = "$$" ]; then
rm "$lock/pid"