No changes between revisions
/Designs/Measuring_instruments/RMDS01A/SW/Tools/sync.sh
38,14 → 38,12
return $EXIT
}
 
# Sort files
# Mask
function tidyup() {
info "sorting $1"
"$TIDYUP" $1
EXIT=$?
if [ $EXIT -eq 1 ]; then
info "No new files to sort"
return 0
elif [ $EXIT -ne 0 ]; then
if [ "$?" -ne 0 ]; then
error "sorting failed, please send logfile.txt to toxygen1@gmail.com"
return 1
fi
52,6 → 50,21
return 0
}
 
# Test public key authentication
function sshtest() {
./test.sh
if [ "$?" -eq 0 ]; then
info "Authentication works"
return 0
else
error "Authentication does not work"
return 1
fi
}
 
# Check if we can connect, otherwise terminate
sshtest || exit 1
 
# Change working directory
cd $1
 
/Designs/Measuring_instruments/RMDS01A/SW/Tools/test.sh
0,0 → 1,5
#!/usr/bin/env bash
 
ssh -o "BatchMode yes" meteor@neptun.avc-cvut.cz "exit"
 
[[ "$?" -eq 0 ]] && exit 0 || exit 1
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/Designs/Measuring_instruments/RMDS01A/SW/Tools/tidyup.sh
66,8 → 66,7
 
# if there are no files with $EXT extension in the directory then quit
ls -f *.$EXT > /dev/null 2>&1
[[ "$?" -ne 0 ]] && exit 1
 
if [ "$?" -eq 0 ]; then
for i in *.$EXT; do
echo "processing " $i
PREFIX=`echo $i | cut -d $DELIM -f1,2`
90,7 → 89,49
done
 
echo -n "$OBSERVATORY$SLASH$YEAR$SLASH$MONTH$SLASH$DAY" > LAST
else
echo "No image files to sort"
fi
 
DIR="bolids"
 
ls -f *.wav > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
for i in bolid_*.wav; do
echo "processing bolid " $i
PREFIX=`echo $i | cut -d $DELIM -f1,2`
OBSERVATORY=`echo $PREFIX | cut -d $DELIM -f2`
TIMESTAMP=`echo "$i" | cut -d $DELIM -f3`
YEAR=20`echo "$TIMESTAMP" | cut -c 1-2`
OUTDIR="$OBSERVATORY$SLASH$DIR$SLASH$YEAR"
[[ -d "$OUTDIR" ]] || mkdir -p "$OUTDIR"
mv $i "$OUTDIR"
done
else
echo "No wav files to sort"
fi
 
ls -f *.aux > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
for i in bolid_*.aux; do
echo "processing bolid metadata " $i
PREFIX=`echo $i | cut -d $DELIM -f1,2`
OBSERVATORY=`echo $PREFIX | cut -d $DELIM -f2`
TIMESTAMP=`echo "$i" | cut -d $DELIM -f3`
YEAR=20`echo "$TIMESTAMP" | cut -c 1-2`
OUTDIR="$OBSERVATORY$SLASH$DIR$SLASH$YEAR"
[[ -d "$OUTDIR" ]] || mkdir -p "$OUTDIR"
mv $i "$OUTDIR"
done
else
echo "No aux files to sort"
fi
 
exit 0