]> git.street.me.uk Git - andy/dehydrated.git/commitdiff
changed urlbase64 helper to also use sed for character replacements
authorLukas Schauer <lukas@schauer.so>
Fri, 8 Jan 2016 19:18:31 +0000 (20:18 +0100)
committerLukas Schauer <lukas@schauer.so>
Fri, 8 Jan 2016 19:18:31 +0000 (20:18 +0100)
letsencrypt.sh

index 751c5e341bb93ca38d7f0cbd1aa5ad73d3407c5f..07d8b1dbf24b36f0ed5756559f516db8cc9e338c 100755 (executable)
@@ -129,7 +129,7 @@ _exiterr() {
 # Encode data as url-safe formatted base64
 urlbase64() {
   # urlbase64: base64 encoded string with '+' replaced with '-' and '/' replaced with '_'
-  openssl base64 -e | tr -d '\n\r' | sed 's/=*$//g' | tr '+/' '-_'
+  openssl base64 -e | tr -d '\n\r' | sed -e 's:=*$::g' -e 'y:+/:-_:'
 }
 
 # Convert hex string to binary data