diff --git a/docs/optimize-images.html b/docs/optimize-images.html index 7ae67d4..1e6606b 100644 --- a/docs/optimize-images.html +++ b/docs/optimize-images.html @@ -69,14 +69,14 @@
Create a script, e.g. /opt/gotify/optimize-images.sh
containing
#!/usr/bin/env sh
+#!/usr/bin/env bash
set -e
DATA=/home/jm/src/gotify/server/data
for FILE in "$DATA"/images/*; do
if [ "$FILE" -nt "$DATA"/images-optimized ]; then
- EXT=$(echo "${FILE#*.}"|tr '[:upper:]' '[:lower:]')
+ EXT=$(echo "${FILE##*.}"|tr '[:upper:]' '[:lower:]')
if [ "$EXT" = png -o "$EXT" = jpg -o "$EXT" = jpeg -o "$EXT" = gif ]; then
convert "$FILE" -resize "512>" "$FILE"
fi
diff --git a/docs/optimize-images/index.html b/docs/optimize-images/index.html
index 7ae67d4..1e6606b 100644
--- a/docs/optimize-images/index.html
+++ b/docs/optimize-images/index.html
@@ -69,14 +69,14 @@ Script
Create a script, e.g. /opt/gotify/optimize-images.sh
containing
-#!/usr/bin/env sh
+#!/usr/bin/env bash
set -e
DATA=/home/jm/src/gotify/server/data
for FILE in "$DATA"/images/*; do
if [ "$FILE" -nt "$DATA"/images-optimized ]; then
- EXT=$(echo "${FILE#*.}"|tr '[:upper:]' '[:lower:]')
+ EXT=$(echo "${FILE##*.}"|tr '[:upper:]' '[:lower:]')
if [ "$EXT" = png -o "$EXT" = jpg -o "$EXT" = jpeg -o "$EXT" = gif ]; then
convert "$FILE" -resize "512>" "$FILE"
fi