From: Paul Hänsch Date: Wed, 19 Jun 2019 03:23:51 +0000 (+0200) Subject: switch for base64 implementation X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=08ca3fa5aa85561baa66ebeac9130bd96e46333d;p=clickslide switch for base64 implementation --- diff --git a/clickslide.sh b/clickslide.sh index 291130a..d42f405 100755 --- a/clickslide.sh +++ b/clickslide.sh @@ -4,12 +4,14 @@ prev='' next='' idoff=0 depth=0 ucdepth=-1 _base64() { - { uuencode -m - <"$1" \ + # busybox does not ship base64, only uuencode. Other platforms might need base64 instead + if which uuencode; then + uuencode -m - <"$1" \ | sed '1d; :X;$!{N;bX;}; s;\n;;g; s;=\+;;g;' - } || { + else base64 <"$1" \ | sed ':X;$!{N;bX;}; s;\n;;g; s;=\+;;g;' - } + fi } { "${0%/*}"/cgilite/html-sh.sed || cat; } \