s4

diff s4-migrate.sh @ 865:8c69e0c2e6af

Stand-alone invocation support
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 02 Sep 2020 17:09:24 +0900
parents fcf485cbabc6
children 2eaa037f35d0
line diff
     1.1 --- a/s4-migrate.sh	Sat Jun 20 18:18:17 2020 +0900
     1.2 +++ b/s4-migrate.sh	Wed Sep 02 17:09:24 2020 +0900
     1.3 @@ -22,6 +22,14 @@
     1.4  
     1.5  query "ATTACH DATABASE \"$dstdb\" AS dst;" || abort "Cannot attach db #{dstdb}"
     1.6  
     1.7 +if [ -z "$tmpd" ]; then
     1.8 +  tmpd=`tmpd=$tmpdir mktempd`	# If called from command line
     1.9 +  if [ -z "$tmpd" -o ! -w "$tmpd" ]; then
    1.10 +    err "-- Cannot detect temporary directory [$tmpd] --"
    1.11 +    exit 2
    1.12 +  fi
    1.13 +  trap "rm -r $tmpd" EXIT INT HUP
    1.14 +fi
    1.15  failure=0
    1.16  for grid; do
    1.17    grid=$((0 + $grid))