]> git.plutz.net Git - clickslide/commitdiff
switch for base64 implementation
authorPaul Hänsch <paul@plutz.net>
Wed, 19 Jun 2019 03:23:51 +0000 (05:23 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 19 Jun 2019 03:23:51 +0000 (05:23 +0200)
clickslide.sh

index 291130a35ba128217c205033a571cae8cb58a6e1..d42f4059b55bc2c1975195904c81d26245bd955a 100755 (executable)
@@ -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; } \