# HG changeset patch # User HIROSE Yuuji # Date 1645339070 -32400 # Node ID b6d1384e1b2c33a0d93bb6886847d52fed3f754e # Parent 759070ee3d204a97ecc9326f7b35f8c49eb6fb24 s4-newworld fixed so that account sychronization done at the time diff -r 759070ee3d20 -r b6d1384e1b2c s4-funcs.sh --- a/s4-funcs.sh Sun Feb 20 08:47:31 2022 +0900 +++ b/s4-funcs.sh Sun Feb 20 15:37:50 2022 +0900 @@ -33,7 +33,7 @@ querylog=${QUERYLOG:-$logdir/query.log} searchlog=${SEARCHLOG:-$logdir/search.log} defaultdb=$dbdir/cgi.sq3 -db=${DB:-$defaultdb} +db=${S4INITDB:-${DB:-$defaultdb}} sessdb=${SESSDB:-$dbdir/sess.sq3} userupdateflag=$dbdir/userupdate sesstb=tmp.sess diff -r 759070ee3d20 -r b6d1384e1b2c s4-newworld.sh --- a/s4-newworld.sh Sun Feb 20 08:47:31 2022 +0900 +++ b/s4-newworld.sh Sun Feb 20 15:37:50 2022 +0900 @@ -34,7 +34,7 @@ echo "wl=$S4WORLDLIST" echo "$dispname:$shortname:$desc" # Create config -DB=db/$shortname.sq3; export DB +S4INITDB=db/$shortname.sq3; export S4INITDB `dirname $0`/s4-init.sh . `dirname $0`/s4-config.sh if ! type htmlescape >/dev/null 2>&1; then @@ -54,6 +54,7 @@ masterdb=`(unset DB; . ./s4-config.sh; echo $DB)` S4MASTERDB=${masterdb:-db/cgi.sq3} +DB=$newdb; export DB echo Synching account: db=$db URL=$URL isCGI=$isCGI mas=$S4MASTERDB . ./s4-world.sh && syncaccount 'force' echo Synching done @@ -67,9 +68,8 @@ S4MASTERURL=\$URL URL=`dirname ${URL}.`/s4-world-$shortname$cgiext S4COLOR="$bgcolor" # Change this! + S4MASTERDB=\$DB # \$DB always points to master DB=$dbdir/$shortname.sq3 - SESSDB=$dbdir/sess.sq3 - S4MASTERDB=$S4MASTERDB S4CSS=$shortname.css TMPDIR=$tmpdir/$shortname EOF diff -r 759070ee3d20 -r b6d1384e1b2c s4-world.sh --- a/s4-world.sh Sun Feb 20 08:47:31 2022 +0900 +++ b/s4-world.sh Sun Feb 20 15:37:50 2022 +0900 @@ -80,7 +80,11 @@ err "`gdate +%S.%3N` Starting account synchronization" SYNC_M=1 - prevsync=`tail -1 $syncflag|colrm 20` # 2020-06-21 12:30:00 = 19cols + if [ -s "$syncflag" ]; then + prevsync=`tail -1 $syncflag|colrm 20` # 2020-06-21 12:30:00 = 19cols + else + prevsync="2000-01-01 00:00:00" + fi syncall=${db%.*}.syncall err syncallfile=$syncall if [ -e $syncall ]; then @@ -173,7 +177,8 @@ runflag=${db%.*}.run userupdateflag=`dirname $S4MASTERDB`/`basename $userupdateflag` test ! -e "$userupdateflag" && return - [ -z "$forceusersync" -a "$syncflag" -nt "$userupdateflag" ] && return + [ -z "$forceusersync" -a -f "$syncflag" -a \ + "$syncflag" -nt "$userupdateflag" ] && return if [ -s "$runflag" ]; then limit=`cat $runflag|tr -c -d 0-9` err syncaccount: limit=$limit