Update flist-reconcile.sh

This commit is contained in:
kneutron 2022-02-28 00:35:14 -06:00 committed by GitHub
parent 63c8e629dd
commit b74c8d8533
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,6 @@
#!/bin/bash5 #!/bin/bash
# if we have a "hanging" flist with no corresponding tar, del
debugg=0 debugg=0
@ -16,13 +18,11 @@ function failexit () {
todel=/tmp/todel-flist.txt todel=/tmp/todel-flist.txt
>$todel # clearit >$todel # clearit
# if flist with no tar, del
declare -i fl tr # integer declare -i fl tr # integer
fl=$(ls flist* |wc -l |awk '{print $1}') fl=$(ls flist* |wc -l |awk '{print $1}')
tr=$(ls *tar* |grep -v flist |wc -l |awk '{print $1}') tr=$(ls *tar* |grep -v flist |wc -l |awk '{print $1}')
echo "Flists: $fl -- Tars: $tr" echo "Flists: $fl -- Tars: $tr"
[[ $fl == $tr ]] && failexit 0 "Flists match tars, evyting OK" [[ $fl == $tr ]] && failexit 0 "Flists match tars, all OK"
# regular array # regular array
declare -a flists=$(ls flist*) declare -a flists=$(ls flist*)