Add debug flag

pull/49/head
Dan Puttick 2017-01-31 15:44:13 -05:00
parent 47f25c07b5
commit 23f9a7b869
5 changed files with 28 additions and 14 deletions

View File

@ -14,7 +14,7 @@ DST_MNT="/media/dst"
TEMP="${DST_MNT}/temp"
ZIPTEMP="${DST_MNT}/ziptemp"
LOGS="${DST_MNT}/logs"
GROOM_LOG="/tmp/groom_log.txt"
DEBUG_LOG="/tmp/groomer_debug_log.txt"
MUSIC="/opt/midi/"
@ -24,3 +24,6 @@ TIMIDITY="/usr/bin/timidity"
MOUNT="/bin/mount"
PMOUNT="/usr/bin/pmount -A -s"
PUMOUNT="/usr/bin/pumount"
# Config flags
DEBUG=true

View File

@ -12,7 +12,11 @@ if ! [ "${ID}" -ge "1000" ]; then
exit
fi
clean(){
clean(){
if [ ${DEBUG} = true ]; then
sleep 20
fi
# Write anything in memory to disk
${SYNC}
@ -58,7 +62,7 @@ do
# Create a directory on ${DST} named PARTION_$PARTCOUNT
target_dir="/media/${DST}/FROM_PARTITION_${PARTCOUNT}"
mkdir -p "${target_dir}"
LOGFILE="${LOGS}/processing.txt"
LOGFILE="${LOGS}/processing_log.txt"
# Run the current partition through filecheck.py
echo "==== Starting processing of /media/${SRC} to ${target_dir}. ====" >> ${LOGFILE}

View File

@ -13,6 +13,9 @@ if [ ${ID} -ne 0 ]; then
fi
clean(){
if [ ${DEBUG} = true ]; then
sleep 20
fi
echo "GROOMER: cleaning up after init.sh."
${SYNC}
# Stop the music from playing
@ -30,7 +33,8 @@ setterm -powersave off -blank 0
echo $! > /tmp/music.pid
# List block storage devices for debugging
# Make sure to set tee in append (-a) mode below if you uncomment
# lsblk |& tee ${GROOM_LOG}
if [ ${DEBUG} = true ]; then
lsblk |& tee -a ${DEBUG_LOG}
fi
su ${USERNAME} -c ./mount_dest.sh |& tee ${GROOM_LOG}
su ${USERNAME} -c ./mount_dest.sh |& tee -a ${DEBUG_LOG}

View File

@ -13,10 +13,13 @@ if ! [ "${ID}" -ge "1000" ]; then
fi
clean(){
echo "GROOMER: Cleaning up in mount_keys.sh."
if [ ${DEBUG} = true ]; then
sleep 20
# Copy the temporary logfile to the destination key
cp ${DEBUG_LOG} "${DST_MNT}/groomer_debug_log.txt"
fi
# Copy the temporary logfile to the destination key
cp ${GROOM_LOG} "${DST_MNT}/groomer_log_dst.txt"
echo "GROOMER: Cleaning up in mount_keys.sh."
# Write anything in memory to disk
${SYNC}

View File

@ -2,11 +2,11 @@
set -x
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh
cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/init.sh /mnt/rpi/opt/groomer/init.sh
cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/groomer.sh /mnt/rpi/opt/groomer/groomer.sh
cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/config.sh /mnt/rpi/opt/groomer/config.sh
cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/mount_dest.sh /mnt/rpi/opt/groomer/mount_dest.sh
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/opt/groomer/music.sh /mnt/rpi/opt/groomer/music.sh
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local
cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/rc.local /mnt/rpi/etc/rc.local
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/pmount.allow /mnt/rpi/etc/pmount.allow
# cp /media/sf_ubuntu-shared/Circlean-Ubuntu/fs_filecheck/etc/udev/rules.d/10-usb.rules /mnt/rpi/etc/udev/rules.d/10-usb.rules