]> git.plutz.net Git - confetti/blob - index.cgi
initial commit
[confetti] / index.cgi
1 #!/bin/zsh
2
3 call=$0
4 real=$call
5
6 die() {
7   echo "$*" >/dev/stderr
8   exit 1
9 }
10
11 while [ -L "$real" ]; do
12   real="$(stat -c %N "$real" |sed -r "s:..*. -> .(.*).$:\1:")"
13 done
14
15 _EXEC="$(dirname "$real")"  #execution directory
16 _STOR="$(dirname "$call")"  #storage directory
17
18 [ -w "$_EXEC" ] && [ -d "$_EXEC" ] || die "storage directory must be writable"
19
20 echo ex: $_EXEC
21 echo st: $_STOR