annotate install @ 0:92c70579720e default tip

Initial commit
author Brad Greco <brad@bgreco.net>
date Wed, 13 Jan 2021 19:25:09 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
1 #!/bin/bash
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
2
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
3 set -e
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
4
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
5 cwd=$(dirname "$0")
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
6
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
7 if [ $EUID -ne 0 ]; then
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
8 echo "This script must be run with root privileges."
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
9 exit 1
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
10 fi
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
11
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
12 if ! which mogrify > /dev/null 2>&1; then
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
13 echo "Please install imagemagick first"
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
14 exit 1
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
15 fi
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
16
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
17 if ! which exiftool > /dev/null 2>&1; then
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
18 echo "Please install libimage-exiftool-perl first"
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
19 exit 1
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
20 fi
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
21
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
22 cp "$cwd/jpeg-exif-thumbnailer" /usr/bin/
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
23 chmod +x /usr/bin/jpeg-exif-thumbnailer
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
24 cp "$cwd/jpeg-exif.thumbnailer" /usr/share/thumbnailers/
92c70579720e Initial commit
Brad Greco <brad@bgreco.net>
parents:
diff changeset
25 grep -l --exclude=jpeg-exif.thumbnailer image/jpeg /usr/share/thumbnailers/*.thumbnailer | xargs --no-run-if-empty sed -i 's|image/jpeg|image/disabled-jpeg|g'