#!/bin/sh -e
if [ $# = 0 ]; then
  x=
else
  [ "${1%%-*}" ]; [ -f "$1" ] # options not supported
  x=".open \"$(printf %s "$1" |sed 's/[\\"]/\\\0/g')\""
  shift
fi
y=/proc/self/fd/3
[ ! -e $y ]
exec /opt/slapos/parts/sqlite3/bin/sqlite3 -init $y '' "$@" 3<<EOF
.load cksumvfs.so
$x
EOF
