old print method

This commit is contained in:
qo-op 2020-05-03 00:13:21 +02:00
parent 584169ed8d
commit 22e898775d
1 changed files with 0 additions and 67 deletions

View File

@ -80,70 +80,3 @@ if [[ $jourdumois == 7 ]]; then
diskSize="$((availableDiskSize / 2))"
ipfs config Datastore.StorageMax $diskSize
fi
##################################################################
if [[ "$1" == "PRINT" ]]; then
##################################################################
##################################################################
# Refresh All peers SWARM Wallets.
##################################################################
ipfs_swarm_wallets_refresh
################################################################################
# PRINT G1Tag PRINTED FROM ANOTHER NODE (TODO: Correct BAD Cypher KEY + BUG why last image png layers are not printed???)
# CREATE and REMOVE rr.bin -> done.rr
if [[ -d "./wallets_swarm/.$IPFSNODEID/PRINT/" ]]; then
log "__SUB:cron_MINUTE.sh: SEARCH NEW PRINT FOR ME .$IPFSNODEID"
mkdir -p ./wallets/.$IPFSNODEID/PRINT/
for qrrtag in ./wallets_swarm/.$IPFSNODEID/PRINT/*.bin; do
rr=$(echo $qrrtag | cut -d '/' -f 5 | cut -d '.' -f 1)
if [[ ! -f "./wallets/.$IPFSNODEID/PRINT/done.$rr" ]]; then
log "__SUB:cron_MINUTE.sh: PRINT G1Tag $rr - START: $(date)"
./shell/natools.py decrypt -k "$NODE_G1AUTHFILE" -i "${qrrtag}" -o "/tmp/G1Tag.png"
log "__SUB:cron_MINUTE.sh: natools.py decrypt - $(date)"
brother_ql_create --model QL-700 "/tmp/G1Tag.png" --label-size 62 > "/tmp/G1Tag.bin"
log "__SUB:cron_MINUTE.sh: brother_ql_create - $(date)"
brother_ql_print "/tmp/G1Tag.bin" /dev/usb/lp0
log "__SUB:cron_MINUTE.sh: brother_ql_print - $(date)"
# INFORM PRINT DONE
echo "OK" > ./wallets/.$IPFSNODEID/PRINT/done.$rr
I=$(ipfs_node_wallets_add)
else
lqrrtag=$(echo "${qrrtag}" | sed s/_swarm//g )
log "__SUB:cron_MINUTE.sh: REMOVE OLD DONE PRINT ${lqrrtag} + ./wallets/.$IPFSNODEID/PRINT/done.$rr"
rm -f "./wallets/.$IPFSNODEID/PRINT/done.$rr"
rm -f "${lqrrtag}"
I=$(ipfs_node_wallets_add)
fi
done
log "__SUB:cron_MINUTE.sh: REMOVE OLD PRINT MARKED AS DONE"
for scan in ./wallets_swarm/.Qm*/PRINT/done.*; do
lscan=$(echo $scan | sed s/_swarm//g )
lid=$(echo $scan | cut -d '/' -f 3 | cut -d '.' -f 2 )
lrr=$(echo $scan | cut -d '/' -f 5 | cut -d '.' -f 2 )
log "__SUB:cron_MINUTE.sh: REMOVE ./wallets/.$lid/PRINT/$lrr.bin OLD PRINT ${lscan} SENT to $lid ($lrr.bin)"
rm -f ./wallets/.$lid/PRINT/$lrr.bin
rm -f "${lscan}"
I=$(ipfs_node_wallets_add)
done
rm "/tmp/G1Tag.bin"
rm "/tmp/G1Tag.png"
fi
fi
##################################################################
##################################################################
if [[ "$1" == "KALKUN" ]]; then
##################################################################
for number in ./wallets/*; do
member=""
phone=$(echo $number | cut -d '/' -f 3);
if [[ -f $number/$phone.uidname ]]; then member=$(cat $number/$phone.uidname); fi
if [[ ! $member ]]; then member=$phone; fi
if [[ $phone && $member ]]; then add_contact $phone $member; log "__SUB:cron_MINUTE.sh: KALKUN add_contact $phone $member"; fi
done
fi
##################################################################