Created
May 16, 2014 00:01
-
-
Save Pesticles/a55344812cf1b9081ada to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Checks the remote storage is mounted and tries to remount it if it's not. | |
# Once it's mounted, move any images waiting from the temporary local storage | |
# to the remote share. | |
# Is it mounted? | |
if ! mount | grep -q '/DATA'; then | |
# Try to mount | |
sudo mount -a | |
# Is it mounted | |
if ! mount | grep -q '/DATA'; then | |
# Exit | |
echo "NOT MOUNTED!!" | |
exit 1 | |
fi | |
fi | |
# Move files | |
if [[ $( ls -1 /home/pi/temp/ | wc -l ) -gt 0 ]]; then | |
mv /home/pi/temp/*.jpg /DATA/Timelapse/ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment