+_base64() {
+ # busybox does not ship base64, only uuencode. Other platforms might need base64 instead
+ if which uuencode >/dev/null; then
+ uuencode -m - <"$1" \
+ | sed '1d; :X;$!{N;bX;}; s;\n;;g; s;=\+;;g;'
+ elif which busybox >/dev/null; then
+ busybox 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