|
| 1 | +#!/bin/bash |
| 2 | +# Insert a single file as a CHK on the global queue with 1416 compatibility mode. |
| 3 | +# This will be used by the new auto-update system. |
| 4 | +# Uses no sensitive keys, so it's a standard insert. |
| 5 | +FILENAME=$1 |
| 6 | +if [[ ! -e "$FILENAME" ]]; then |
| 7 | + echo "Usage: insert-compat-1416 <filename>" |
| 8 | +fi |
| 9 | +SHORTNAME=$(basename "$FILENAME") |
| 10 | +PORT=9481 |
| 11 | +TEMPFILE=`mktemp /tmp/insert.temp.XXXXXXXXXX` |
| 12 | +echo Tempfile is $TEMPFILE |
| 13 | +echo ClientHello > $TEMPFILE |
| 14 | +echo "Name=Toad-update-$VERSION" >> $TEMPFILE |
| 15 | +echo ExpectedVersion=2 >> $TEMPFILE |
| 16 | +echo End >> $TEMPFILE |
| 17 | +echo >> $TEMPFILE |
| 18 | +echo ClientPut >> $TEMPFILE |
| 19 | +echo "DontCompress=true" >> $TEMPFILE |
| 20 | +echo "CompatibilityMode=COMPAT_1416" >> $TEMPFILE |
| 21 | +echo "URI=CHK@" >> $TEMPFILE |
| 22 | +echo "Identifier=Insert-$SHORTNAME" >> $TEMPFILE |
| 23 | +echo Verbosity=1023 >> $TEMPFILE |
| 24 | +echo MaxRetries=-1 >> $TEMPFILE |
| 25 | +echo UploadFrom=direct >> $TEMPFILE |
| 26 | +echo DataLength=`ls -l "$FILENAME" | cut -d " " -f 5` >> $TEMPFILE |
| 27 | +echo Persistence=forever >> $TEMPFILE |
| 28 | +echo PriorityClass=1 >> $TEMPFILE |
| 29 | +echo Global=true >> $TEMPFILE |
| 30 | +echo "TargetFilename=$SHORTNAME" >> $TEMPFILE |
| 31 | +echo End >> $TEMPFILE |
| 32 | +cat "$FILENAME" >> $TEMPFILE |
| 33 | + |
| 34 | +cat $TEMPFILE | nc 127.0.0.1 $PORT |
| 35 | + |
| 36 | +rm -Rf $KEYS |
| 37 | +rm -Rf $TEMPFILE1 |
0 commit comments