-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcamera-inserted
More file actions
executable file
·31 lines (26 loc) · 847 Bytes
/
Copy pathcamera-inserted
File metadata and controls
executable file
·31 lines (26 loc) · 847 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Stupid script to clean of a camera's SD card (or whatever) for reuse.
debug=
if [ "$debug" != "" ] ;then
echo `whoami`>/tmp/camera
fi
[ ! -d ~/pics -o ! -d "$1/dcim" ] && echo "missing either source or destination directory" && exit 1
zenity --info --text "Camera-type thingie inserted, moving pictures etc to ~/pics" &
for dir in $1/dcim/*; do
for file in $dir/*; do
if [ "$debug" != "" ];then
echo "$file" >>/tmp/camera
fi
mv "$file" ~/pics
# Clear extranious a+x permissions on coppied files - they're not really executable.
chmod a-x ~/pics/${file##*/}
done
done
if [ "$debug" != "" ] ;then
set >>/tmp/camera
mount >>/tmp/camera
fi
umount $1
mplayer /usr/share/sounds/KDE_Beep_ClockChime.wav
zenity --info --text "Done moving pictures, media is unmounted and you may remove it" &
rsync -avub ~/pics herb: