From: paul Date: Sun, 28 Jul 2013 16:31:17 +0000 (+0000) Subject: initial commit X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=815886bd4a95d4a44691f1cfd9701b8c3cecb5dc;p=lobster initial commit svn path=/trunk/; revision=1 --- 815886bd4a95d4a44691f1cfd9701b8c3cecb5dc diff --git a/index.cgi b/index.cgi new file mode 100755 index 0000000..919cf24 --- /dev/null +++ b/index.cgi @@ -0,0 +1,21 @@ +#!/bin/zsh + +call=$0 +real=$call + +die() { + echo "$*" >/dev/stderr + exit 1 +} + +while [ -L "$real" ]; do + real="$(stat -c %N "$real" |sed -r "s:..*. -> .(.*).$:\1:")" +done + +_EXEC="$(dirname "$real")" #execution directory +_STOR="$(dirname "$call")" #storage directory + +[ -w "$_EXEC" ] && [ -d "$_EXEC" ] || die "storage directory must be writable" + +echo ex: $_EXEC +echo st: $_STOR