s4

changeset 865:8c69e0c2e6af

Stand-alone invocation support
author HIROSE Yuuji <yuuji@gentei.org>
date Wed, 02 Sep 2020 17:09:24 +0900
parents 45e95d6ee863
children a2e2bf4ee7eb
files s4-migrate.sh
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/s4-migrate.sh	Fri Aug 07 22:27:04 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))