open_wrapper.sh: make the wrapper script POSIX shell compliant
[conversations_http_downloader.git] / open_wrapper.sh
index 6a3d0d3..7f35ce8 100755 (executable)
@@ -32,7 +32,7 @@ decrypted_file()
   echo "${TEMPDIR}/${FILENAME}"
 }
 
   echo "${TEMPDIR}/${FILENAME}"
 }
 
-if [ ${URL: -97:1} = "#" ];
+if echo -n "$URL" | grep -q '#[[:xdigit:]]\{96\}$';
 then
   DESTINATION=$(decrypted_file "$URL")
 else
 then
   DESTINATION=$(decrypted_file "$URL")
 else