Compare commits

...

3 Commits

Author SHA1 Message Date
6eb456e667 sync-camera: Remove executable permission from file.
This happens because the device is a FAT32 formatted SD card, thus by
default everything is executable. But when transferring to my computer
this isn't necessary.
2025-01-16 09:43:34 +01:00
191784d1f2 sync-camera: require arguments. 2025-01-16 09:42:50 +01:00
e132462e5c sync-camera: clarify output path in info message. 2025-01-16 09:40:51 +01:00

View File

@ -11,6 +11,13 @@ function print_usage() {
echo "USAGE: ${0##*/} -d <device> -o <dir> [-t <dir>] [-r]"
}
if [ $# -eq 0 ]
then
>&2 echo "No arguments specified!"
print_usage
exit 1
fi
while getopts "d:o:t:rh" opt
do
case "$opt" in
@ -64,8 +71,9 @@ do
OUTPUT_PATH="$OUTPUT_DIR/${INPUT_FILE##*/}"
if ! [ -f "$OUTPUT_PATH" ]
then
echo "Copying ${INPUT_FILE} to ${OUTPUT_PATH} ..."
echo "Copying ${INPUT_FILE} to ${OUTPUT_PATH::-4}.jpg ..."
cp "$INPUT_FILE" "${OUTPUT_PATH::-4}.jpg"
chmod -x "${OUTPUT_PATH::-4}.jpg"
fi
if [ $REMOVE_FILES -eq 1 ]
@ -80,7 +88,7 @@ do
OUTPUT_PATH="$OUTPUT_DIR/${INPUT_FILE##*/}"
if ! [ -f "$OUTPUT_PATH" ]
then
echo "Converting ${INPUT_FILE} to MP4 at ${OUTPUT_PATH} ..."
echo "Converting ${INPUT_FILE} to MP4 at ${OUTPUT_PATH::-4}.mp4 ..."
ffmpeg -loglevel fatal -nostdin -i "$INPUT_FILE" "${OUTPUT_PATH::-4}.mp4"
fi