Skip to content

Commit 2738f8b

Browse files
committed
Trivial helper script
1 parent eee7d12 commit 2738f8b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

scripts/pem-to-oneliner.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# Convert a PEM file to a single line for use in an environment variable
6+
if [ $# -ne 1 ]; then
7+
echo "Usage: pem-to-oneliner.sh <pem-file>"
8+
exit 1
9+
fi
10+
11+
PEM_FILE=$1
12+
13+
if [ ! -f "${PEM_FILE}" ]; then
14+
echo "File not found: ${PEM_FILE}"
15+
exit 1
16+
fi
17+
18+
# Convert the PEM file to a single line
19+
# use tr to remove newlines
20+
tr -d '\n' < "${PEM_FILE}"

0 commit comments

Comments
 (0)